{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# p3 - montha = Balance-P monthb =(MI*montha montha-P...

This preview shows pages 1–2. Sign up to view the full content.

print"Payment Calculator" import conversionCheck as cc #D is the amount of debt initally inStringA=raw_input("\nEnter amount of debt:") #I is the interest rate inStringB=raw_input("Enter interest rate:") #P is the amount of each payment inStringC=raw_input("Enter monthly payment:") goodInputA = cc.couldBeFloat(inStringA) goodInputB = cc.couldBeFloat(inStringB) goodInputC = cc.couldBeFloat(inStringC) if not goodInputA: print "Please enter valid number" elif not goodInputB: print "Please enter valid number" elif not goodInputC: print "Please enter valid number" else: D=inStringA I=inStringB P=inStringC D=float(D) I=float(I) P=float(P) # MI stand for Monthly Interest MI=(.01*I)/12 #Balance Calculates the balance before the first payment Balance=(D+((MI)*D))

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: montha = Balance-P monthb =(((MI)*montha)+montha)-P xyz=Balance-P if monthb>montha: print"\nAt this rate you will never pay off your debt." elif P>D: print "\nMonth 1", "\nBalance going forward = \$ 0.00", print "\n\nTotal Payments: \$", "%.2f"%(D+(MI*D)) else: month=1 if montha>=monthb: print "\nMonth", month print "Balance going forward = \$","%.2f"%float(Balance-P) while montha > 0: month=month+1 montha = (((MI)*montha)+montha)-P print "\nMonth", month # this is to calculate total payment if montha < P: last = montha+P if montha < 0: montha = 0 print "Balance going forward = \$","%.2f"%montha Total=(P*(month-1))+ last print "\nTotal Payments: \$","%.2f"%Total raw_input("Press enter to exit.")...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

p3 - montha = Balance-P monthb =(MI*montha montha-P...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online