Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Latest commit

 

History

History
22 lines (14 loc) · 1.63 KB

File metadata and controls

22 lines (14 loc) · 1.63 KB

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.