ComeçarComece de graça

Financial returns (1)

Time for some application! Earlier, Lore taught you about financial returns. Now, its time for you to put that knowledge to work! But first, a quick review.

Assume you have $100. During January, you make a 5% return on that money. How much do you have at the end of January? Well, you have 100% of your starting money, plus another 5%: 100% + 5% = 105%. In decimals, this is 1 + .05 = 1.05. This 1.05 is the return multiplier for January, and you multiply your original $100 by it to get the amount you have at the end of January.

105 = 100 * 1.05

Or in terms of variables:

post_jan_cash <- starting_cash * jan_mult

A quick way to get the multiplier is:

multiplier = 1 + (return / 100)

Este exercício faz parte do curso

Introduction to R for Finance

Ver curso

Instruções do exercício

  • Your new starting cash, January's return, and January's return multiplier have been defined for you.
  • Use them to calculate post_jan_cash.
  • Print post_jan_cash.
  • What if the return for January was 10%? Calculate the new jan_mult_10.
  • Calculate post_jan_cash_10 using the new multiplier!
  • Print post_jan_cash_10 to see the impact of different interest rates!

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Variables for starting_cash and 5% return during January
starting_cash <- 200
jan_ret <- 5
jan_mult <- 1 + (jan_ret / 100)

# How much money do you have at the end of January?
post_jan_cash <- 

# Print post_jan_cash


# January 10% return multiplier
jan_ret_10 <- 10
jan_mult_10 <- 

# How much money do you have at the end of January now?
post_jan_cash_10 <- 

# Print post_jan_cash_10
Editar e executar o código