Guest User

problem with balance

a guest
Nov 2nd, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. balance= float((raw_input('Enter the outstanding balance on your credit card: ')))
  2. annualinterestrate= float((raw_input('Enter the credit interest as a decimal: ')))
  3. minmonthlypaymentrate= float((raw_input('Enter the minimum monthly payment rate as a decimal: ')))
  4.  
  5. Monthlyinterestrate = annualinterestrate/12
  6. nummonths = 1
  7. totalamtpaid = 0
  8.  
  9. while nummonths <= 12:
  10.     minmonthlypayment = round(minmonthlypaymentrate * balance,2)
  11.     interestpaid = round(Monthlyinterestrate * balance,2)
  12.     principalpaid = (minmonthlypaymentrate - interestpaid
  13.     balance = principalpaid
  14.  
  15. print('month:',nummonths)
  16. print('minimum monthly payment:',minpayment)
  17. print('remaining balance:',balance)
  18.  
  19. nummonths+= 1
Advertisement
Add Comment
Please, Sign In to add comment