(2) Suppose you deposit a certain amount of money into a savings account that earns compound monthly interest, and you want to calculate you will have after a specific amount number of months. The formula is:

F = P * (1 + i)t


Where the terms in the formula are as follows:

F is the future value of the account after the specified amount of time.

P is the present value, or the amount that you want deposit.

i is the monthly interest rate.

t is the number of months that you plan to let the money sit in the account.

Write a function called futureValue() that takes on three arguments: P, i and t which returns the future value.


javascript

Respuesta :

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)

ACCESS MORE
EDU ACCESS