codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
balance = 3926 annualInterestRate = 0.2 monthlyPaymentRate = 0.04 monthlyInterestRate = annualInterestRate/12 mmp = 10 m = 1 while(balance > 0): balance = 3926 m = 1 mmp += 10 while(m <=12): m += 1 balance = (balance - mmp)*(1 + monthlyInterestRate) print round(balance,2) print 'Remaining balance: ',round(balance,2) if(balance <= 0 and mmp > 0): print 'Lowest Payment: ', mmp
Private
[
?
]
Run code
Submit