CoCalc Public Files2020-09-29-112728.ipynb
Author: Julia Burnside
Views : 48
Compute Environment: Ubuntu 20.04 (Default)

Compare and comment on the following two saving plans:

In [1]:
i1=1000
r1=0.044
n1=12
c1=1
t1=30

i2=0
r2=0.044
n2=12
c2=5
t2=30

def oneDeposit(p, r, n, c, t):
oneDepositTotal=(p*(1+(r/n))**(n*t))
return oneDepositTotal

def monthlyPayments(p, r, n, c, t):
monthlyPaymentsTotal=(c*((1+(r/n))**(n*t)-1)/(r/n))
return monthlyPaymentsTotal

print("Total Principal using a 1 time deposit plan:", '\n')
print("Initial Pricipal: $", i1, '\n') print("Annual Interest: ", round(r1*100, 2), "%", '\n') print("Compoundings per year: ", n1, '\n') print("Contributions per compounding period:$", c1, '\n')
print("Compounding period (In years): ", t1, '\n')
ptotal1=oneDeposit(i1, r1, n1, c1,  t1)
print("Cumulative amount deposited: $", i1, '\n') print("Cumulative account balance:$", round(ptotal1, 2), '\n', '\n')

print("Total Principal using a monthly payment plan:", '\n')
print("Initial Pricipal: $", i2, '\n') print("Annual Interest: ", round(r2*100, 2), "%", '\n') print("Compoundings per year: ", n2, '\n') print("Contributions per compounding period:$", c2, '\n')
print("Compounding period (In years): ", t2, '\n')
ptotal2=monthlyPayments(i2, r2, n2, c2, t2)
print("Cumulative amount deposited: $", c2*n2*t2, '\n') print("Cumulative account balance:$", round(ptotal2, 2), '\n', '\n')

if (ptotal1<ptotal2):
print("A monthly payment plan will produce greater savings of $", round(ptotal2-ptotal1, 2), '\n''\n') else: print("A 1 time deposit plan will produce greater savings of$",     round(ptotal1-ptotal2, 2), '\n''\n')

if (i1<(c2*n2*t2)):
print("A monthly payment plan will require a lesser deposit amount of $", round((c2*n2*t2)-i1, 2), '\n''\n') else: print("A 1 time deposit plan will require a lesser deposit amount of$",     round(i1-(c2*n2*t2), 2), '\n''\n')

Total Principal using a 1 time deposit plan: Initial Pricipal: $1000 Annual Interest: 4.4 % Compoundings per year: 12 Contributions per compounding period:$ 1 Compounding period (In years): 30 Cumulative amount deposited: $1000 Cumulative account balance:$ 3734.4 Total Principal using a monthly payment plan: Initial Pricipal: $0 Annual Interest: 4.4 % Compoundings per year: 12 Contributions per compounding period:$ 5 Compounding period (In years): 30 Cumulative amount deposited: $1800 Cumulative account balance:$ 3728.72 A 1 time deposit plan will produce greater savings of $5.67 A monthly payment plan will require a lesser deposit amount of$ 800