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

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

View Full Document Right Arrow Icon
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))
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
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

This note was uploaded on 02/21/2010 for the course ECS 40175 taught by Professor Amenta during the Fall '09 term at UC Davis.

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 Right Arrow Icon
Ask a homework question - tutors are online