The value of an investment at a particular date in the future that is equivalent
ID: 3852446 • Letter: T
Question
The value of an investment at a particular date in the future that is equivalent in value to a specified sum today. There are two ways to calculate FV: For an asset with simple annual interest: future Value = principal times (1 + (rate times years)) For an asset with interest compounded annually: future Value = principal times (1 + rate)^years Where: principal = Initial amount = 1000 years = number of years = vanes from 1 to 10 rate = rate of interest in percentage = 5%, 6%, 7%, 8%, 9%, 10% You may use Math.pow ((1.0 + rate), year) No user input is required for this program Use two for-loops and print statements Expected OutputExplanation / Answer
Hi,
Please find below the Python code-
Python code-
import math
principal = 1000.0
for years in range(1,10):
for rate in range(5,10):
print("Future value with simple interest Rate")
print("Year Amount(5%) Amount(6%) Amount(7%) Amount(8%) Amount(9%) Amount(10%)")
print("%d %9.2f" % (years,principal*(1+((rate/100.00)*years))),sep=' ', end=' ')
for years in range(1,10):
for rate in range(5,10):
print("Future value if interest rate compounded Annually")
print("Year Amount(5%) Amount(6%) Amount(7%) Amount(8%) Amount(9%) Amount(10%)")
print("%d %9.2f" % (years,principal*math.pow((1.0+(rate/100.00)),years)))
Regards,
VinaySingh
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.