Guest User

Untitled

a guest
Jul 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. annualInterestRate=.2
  2. balance=320000
  3. monthlyInterestrate=annualInterestRate/12
  4. balance_initial=balance
  5. lowerbound=(1/12)*balance
  6. upperbound=balance*(1+monthlyInterestrate)**(12)/12
  7. monthlyPayment=(upperbound+lowerbound)/2
  8. while balance>-.00001 and balance<.00001:
  9. for i in range(12):
  10. balance=balance-monthlyPayment + (balance-monthlyPayment)*monthlyInterestrate
  11. if balance>0:
  12. lowerbound=monthlyPayment
  13. if balance<0:
  14. upperbound=monthlyPayment
  15.  
  16. print('Lowest Payment: ' + str(round(monthlyPayment, 2)))
Add Comment
Please, Sign In to add comment