Guest User

python

a guest
Nov 3rd, 2012
78
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')))
  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.     nummonths += 1
  15.  
  16. print('month:',nummonths)
  17. print('minimum monthly payment:',minmonthlypayment)
  18. print('remaining balance:',balance)
Advertisement
Add Comment
Please, Sign In to add comment