Answer:
Explanation:
def compoundInterest (p, r, t):
f=p*pow((1+r/100), t)
return f
p=0
while p<=0:
p=float( input("\nEnter the present value of the account in dollars : "))
if p<=0:
print("\nInvalid value")
r=0
while r<=0 or r>100:
r=float( input("\nEnter the monthly interest rate as a percentage :"))
if r<=0 or r>100:
print("\nInvalid Value")
t=0
while t<=0:
t=float(input("\nEnter thr number of months :"))
if t<=0:
print("\nInvalid Value")
f=compoundInterest(p, r, t)
print("\nPresent Value : $", p)
print("\nInterest Rate : % ", r)
print("\nAfter ",t , " months, the value of your account will be $ ", f)