Responses for exercises in Exercism.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.6 KiB

Hints

General

1. Calculate the interest rate

  • By default, any floating-point number defined in C# code is treated as a double. To use a different floating-point type (like float or decimal), one must add the appropriate suffix to the number.

2. Calculate the annual balance update

  • When calculating the annual yield, it might be useful to temporarily convert a negative balance to a positive one. One could use arithmetic here, or one of the methods in the Math class.

3. Calculate the years before reaching the desired balance

  • To calculate the years, one can keep looping until the desired balance is reached. C# has several looping constructs.
  • There is a special operator to increment values by 1.