Guest User

Untitled

a guest
Jan 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. y=balance
  2. cmin=balance/12
  3. cmax=(balance*(1+(annualInterestRate/12))**12)/12
  4. while y>0:
  5. c=(cmin+cmax)*0.5
  6. y=(balance-c)*(1+annualInterestRate/12)
  7. for Month in range (2,13):
  8. y=(y-c)*(1+annualInterestRate/12)
  9. if y>0:
  10. cmin=c
  11. elif y<=-0.01:
  12. cmax=c
  13. y=abs(y)
  14. else:
  15. print('Lowest Payment:')+str(round(c,2))
Add Comment
Please, Sign In to add comment