Question: Create a Python program named cst - 1 5 0 - future - investment.py . Write a function called futureValue that takes the investment amount,

Create a Python program named cst-150-future-investment.py.
Write a function called futureValue that takes the investment amount, annual interest rate, and the number of years as arguments. The interest rate should have a default value of 7%, and you can add default values of your choice for the number of years. This function should calculate and print a table that displays the future values for each year.
Write another function called main that demonstrates the futureValue function by prompting the user to enter the investment amount, annual interest rate, and the number of years.
Format your output to two decimal places.
Save and run your program to demonstrate the calculation of future values.
Sample Output:
Enter the amount you want to invest: 1000[Enter]
Enter the interest rate for your investment (default is 7%): 9[Enter]
Enter the number of years you want to invest this money (default is 5): 30[Enter]
Years Future Value
11093.81
21196.41
...
3014730.58
Note: Replace the ellipsis (...) with the actual future values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!