Guest User

Untitled

a guest
Oct 13th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. balance = 5000
  2. annualInterestRate = 0.18
  3. minMonthlyPayment = round((0.02 * balance),2)
  4. interest = 0
  5. totalPaid = 0
  6. month = 1
  7.  
  8. while month <=12:
  9.  
  10.  
  11. print 'Month: ' + str(month)
  12. print 'Minimum monthly payment: ' + str(minMonthlyPayment)
  13.  
  14. interest = (balance - minMonthlyPayment) * (annualInterestRate/12)
  15. balance -= round(minMonthlyPayment + interest,2)
  16.  
  17. totalPaid += minMonthlyPayment
  18.  
  19. print 'Remaining balance: ' + str(balance)
  20.  
  21. month += 1
  22.  
  23. print 'Total paid: ' + str(totalPaid)
  24. print 'Remaining balance: ' + str(balance)
Advertisement
Add Comment
Please, Sign In to add comment