Guest User

Untitled

a guest
Jan 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. monthlyInterestRate = annualInterestRate/12
  2. lowBnd = balance/12
  3. upBnd = (balance * (1 + monthlyInterestRate)**12)/12
  4. payment = (lowBnd + upBnd)/2.0
  5. MP = 12
  6. remaining = (balance)
  7. while balance > 0.00:
  8. balance = remaining
  9. MP = 0
  10. while MP < 13:
  11. if balance <= 0.0:
  12. lowBnd = payment
  13. else:
  14. upBnd = payment
  15. MP = MP + 1
  16. balance = (balance - ((lowBnd + upBnd)/2.0)) * (1 + monthlyInterestRate)
  17.  
  18. print 'Lowest Payment: ', +(round(payment,2))
Add Comment
Please, Sign In to add comment