10. Exercise¶
We want to develop a program that determines the future value of an investment, given the initial value and the interest rate
We follow the steps for development.
- Analysis:
The initial money generates an annual interest rate
How much will it be worth in 10 years?
Input: initial amount, interest rate
Output: value in 10 years
- Specification:
The user enters the initial amount invested
The user enters the annual interest rate
Value of the financial mathematical formula * (1 + interest)
- Design:
Enter the initial investment amount.
Enter the interest rate.
- Repeat 10 times:
initial value = initial value * (1 + interest rate)
Print the updated value.
- Implementation:
- Test values:
1000 dollars investment and 3% annual interest rate
1000 dollars investment and 10% annual interest rate
10.1. FAQs¶
You have attempted of activities on this page