Professional Documents
Culture Documents
Codingcalculator Payoffacarloan
Codingcalculator Payoffacarloan
Codingcalculator Payoffacarloan
atstartof
themonth
Monthly
interest
rate
Interest
forthe
month
$10,000
.004
$40.00
$10,040
$9,640
.004
$38.56
$9,678.56 $400.00
$9,278.56
$9,278.56
.004
$37.12
$9,315.68 $400.00
$8,915.68
$8,915.68
.004
$35.66
$8,951.34 $400.00
$8,551.34
$8,551.34
.004
$34.21
$8,585.55 $400.00
$8,185.55
$400.00
$9640
print"WelcometoRena'sLoanPaymentCalculator.Pleaseentertheprincipleoftheloan"
#ThisstorestheprincipalamountinthevariableP
P=float(raw_input())
print"Thanks.Nowpleasetellmetheannualinterestrateoftheloan.Pleaseputinsomething
like4%as0.04"
#Heretheuserenterstheannualinterestrate.
I=float(raw_input())
#Herewefindoutthemonthlyinterestrate.
r=I/12
print"Sofar,sogood.andhowmuchwillyoubepayingbackpermonth?"
#ThisstoresthemonthlypaymentinthevariableMP
MP=float(raw_input())
print"Nicejob.Youseemtoknowhowtoenternumbers."
m=0
whileP>MP:
P=P+P*rMP
m=m+1
printm,P
print"Thenumberonthebottomisaccurate."