Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##O2F - vFinal
- ## -- Starting variable definition --
- iloan=float(raw_input('valor: ')) #initial balance
- arate=float(raw_input ('annual rate: ')) #annual rate
- mrate=arate/12 #month rate
- mmp=10 #initial minimum pay
- month=0 #months counter start
- fmonth=12 #final months (1 yr)
- ##mmp=float(raw_input ('valor minimo que quer pagar [TESTE]: ')) # /*if you with to start with other mmp - note: comment previous defined mmp and uncomment this one */
- ##fmonth=int(raw_input ('meses: ')) # /*if you want to change the max paying months available - note: comment previous defined fmonth and uncomment this one */
- loan=iloan
- ## -- Starting Iteration--: /* While the loan is greater than 0 and the month are less or at least equal to "fmonth" it tests for the initial mmp set, if the months pass the "fmonth" set it resets month's counter and increment mmp with 10. */
- while loan>0:
- if(month<=fmonths):
- loan=loan*(1+mrate)-mmp
- month=month+1
- if month==fmonths+1:
- month=0
- mmp=mmp+10
- loan=iloan
- ##print mmp # uncomment only for debbuging :P
- print ('what you have to pay per month: '), mmp, ('$')
- print ('how many months you need: '),month
- print ('what is the final balance: '), loan
Advertisement
Add Comment
Please, Sign In to add comment