Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 1.43 KB

File metadata and controls

20 lines (12 loc) · 1.43 KB

General

1. Calculate the annual percentage yield

  • 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.