mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-11-09 21:30:47 -05:00
22 lines
No EOL
907 B
Markdown
22 lines
No EOL
907 B
Markdown
# Hints
|
|
|
|
## 1. Calculate the interest rate
|
|
|
|
- You are expected to return a percentage.
|
|
|
|
## 2. Calculate the interest
|
|
|
|
- When calculating interest, it might be helpful to notice that `interest_rate` returns a percentage.
|
|
- You can use the function defined in the previous task (`interest_rate`) to calculate the interest.
|
|
|
|
## 3. Calculate the annual balance update
|
|
|
|
- When calculating the annual balance update, use the functions that have been defined in the previous steps.
|
|
|
|
## 4. Calculate the years before reaching the desired balance
|
|
|
|
- To calculate the years, one can keep looping until the desired balance is reached using a [`for`][for] loop.
|
|
- There is a special [operator][increment] to increment values by 1.
|
|
|
|
[for]: https://www.learncpp.com/cpp-tutorial/introduction-to-loops-and-while-statements/
|
|
[increment]: https://www.learncpp.com/cpp-tutorial/increment-decrement-operators-and-side-effects/ |