python question: Please upload screenshot and be precise with answer the questio
ID: 3830098 • Letter: P
Question
python question:
Please upload screenshot and be precise with answer the question exactly as shown in the picture (exact decimal numbers and loop with underline)
Problem Description: Write a fuunction that computes future investment value at a given interest rate for a specified number of years. The future investment is determined using the following formula: future Investment Value investmentAmount x (1 numberOf Years 12 Use the following function header: def value investmentAmount, monthlylnterestRate, years) futureEnvestment For example, futureInvestmentvalue(10000, 0.05/12, 5) returns 12833.59. write a test program that prompts the user to enter the investment amount (e.g., 1000) and the interest rate (e.g., 9%) and prints a table that displays future value for the years from 1 to 30, as shown below: The amount invested: 1000 Annual interest rate 9% ears Future Value 1093.80 1196 Al 13467.25 14730.57Explanation / Answer
from __future__ import division
def futureInvestmentValue(investmentAmount, monthlyInterestRate, years):
futValue = investmentAmount*((1+monthlyInterestRate)**(years*12))
return futValue
investmentAmount = float(input("The amount invested: "))
rate = float(input("Annual interest rate: "))
monthlyInterestRate = rate/12/100
print("Years_________________Future Value")
for i in range(1, 31):
print(str(i) + "______________________" + "{0:.2f}".format(futureInvestmentValue(investmentAmount,monthlyInterestRate, i)))
# code link: https://paste.ee/p/LbLe1
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.