143k views
1 vote
Write a program in Python that reads in investment amount, annual interest rate, and number of years, and displays the future investment value using the following formula:and displays the future investment value using the following formula:futureInvestmentValue = investmentAmount * (1 + monthlyInterestRate)numberOfYears*12

User Ramanlfc
by
5.2k points

1 Answer

1 vote

Answer:

investmentAmount = float(input("enter the investment amount: "))

annualInterestRate = float(input("enter the Annual Interest Rate: "))

numYears = int(input("Enter NUmber of Years: "))

monthlyInterestRate = annualInterestRate/12

futureInvestmentValue = investmentAmount * (1 + monthlyInterestRate)*(numYears*12)

print("The Future Investment Value is: ")

print(futureInvestmentValue)

Step-by-step explanation:

Using python programming language as required, we use the input function to prompt user for inputs for each of the variables.

There is a conversion from the variable annualInterestRate to monthlyInterestRate before the formula for the futureInvestmentValue is applied

User Lfa
by
5.9k points