# futval.py

# A program to compute the future investment values with compound interest

# and compare the difference between them

import math

print "This program computes the future investment values with compound interest"

print " compares the difference between them"



p= input("Enter the initial principle:")

r= input("Enter the interest rate:")

n= input("Enter the number of times the interest is compounded per year:")

t= input("Enter the time expressed as a number of years:")





A1= p*((1+r/n)**(n*t))

print "A1 = ", A1



A2=p

for i in range(1,n*t+1):

    A2=A2*(1+r/n)

    print "A2 = ", A2



B= p*math.exp(r*t)

print "B = ", B



D1= 100*((abs(A1-A2))/A1)

print "D1 = ", D1



D2= 100*((abs(A1-B))/2)

print "D2 = ", D2



"""

Yes, n and t have to be integers because the decimal values would give us errors if substituted in the range.



"""

