1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to R for Finance

Exercise

Financial returns (2)

Let's make you some more money. If, in February, you earn another 2% on your cash, how would you calculate the total amount at the end of February? You already know that the amount at the end of January is $100 * 1.05 = $105. To get from the end of January to the end of February, just use another multiplier!

$105 * 1.02 = $107.1

Which is equivalent to:

$100 * 1.05 * 1.02 = $107.1

In this last form, you see the effect of both multipliers on your original $100. In fact, this form can help you find the total return over both months. The correct way to do this is by multiplying the two multipliers together: 1.05 * 1.02 = 1.071. This means you earned 7.1% in total over the 2 month period.

Instructions

100 XP
  • Your starting cash, and the returns for January and February have been given.
  • Use them to calculate the January and February return multipliers: jan_mult and feb_mult.
  • Use those multipliers and starting_cash to find your total_cash at the end of the two months.
  • Print total_cash to see how your money has grown!