Wednesday, December 29, 2010

Loan payment plan

# For home buyers
# Loan payment plan ( fixed monthly)
# r ( anual interest rate 3.4% )
# l amount borrowed
# n duration in moths
r=0.034
l=180000
n=360
c=r/12
p=l*(c*(1+c)^n)/((1+c)^n-1)
amort = 0
tota=0
toti=0
for m = 1 to n
l=l-amort
inter = l*c
amort=p-inter
tota=tota+amort
toti=toti+inter
prest=inter+amort
print "Month ="+m+" Amort.="+int(amort*100)/100+" Intrest="+int(inter*100)/100+" Total="+int(prest*100)/100
next m
print
print "Monthly payment = "+p
Print "Total amortization = "+tota

Print "Total interest = "+toti

No comments:

Post a Comment