# futureValue.py
# Given the principal amount, the interest rate and the number of compounding periods,
# the program calculates the value of the investment ten years into the future.
def main():
print("Given the principal amount, the interest rate and the number of compounding periods,\n \
the program calculates the value of the investment ten years into the future.");
p = eval(input("Enter the amount to invest (principal):"))
apr = eval(input("Enter the interest rate (APR) in percent %:")) / 100 # immediately convert from % to decimal
c = eval(input("Enter the number of compounding periods:\n \
(1 for annually, 2 for semiannually, 3 for every 4 months,...) "))
result = p # using extra variable to keep the value of p unchanged
for i in range(10): # 10 iterations for 10 years
result = result * ((1 + apr / c)**c) # every year the balance in changing
print("In ",i+1,"year(s) the balance is ",result)
main()