exercism/cpp/interest-is-interesting/HINTS.md

22 lines
907 B
Markdown
Raw Normal View History

# 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/