Question: Write a program in python that will compute the balance of an investment of monthly deposits over time with interest. Start the program with these
Write a program in python that will compute the balance of an investment of monthly deposits over time with interest.
- Start the program with these prompts and input values:
years = float(input("Enter the number of years to simulate: ")) months = int(12 * years) annual_interest_rate = float(input("Enter the annual interest rate: ")) monthly_interest_rate = annual_interest_rate / 12.0 monthly_deposit = float(input("Enter the monthly amount deposited: ")) balance = 0.0 - Complete the code to loop over each month from 0 to months:
- Compute the interest for the month by multiplying monthly_interest_rate by the balance
- Add the interest for the month and the monthly_deposit to the balance
- Print the month number, interest for the month, and balance
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
