Guest User

Untitled

a guest
Jul 16th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #A program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month.
  2.  
  3. balance = 42
  4. annualInterestRate = 0.2
  5. monthlyPaymentRate = 0.04
  6.  
  7.  
  8. def newb(balance, annualInterestRate, monthlyPaymentRate):
  9. for i in range(12):
  10. newbalance = (balance-(balance*monthlyPaymentRate))
  11. balance = newbalance + ((annualInterestRate/12)*newbalance)
  12. print balance
  13. i += 1
  14. return round(balance,2)
  15.  
  16. print('Remaining balance: '+ str(newb(balance, annualInterestRate, monthlyPaymentRate)))
  17.  
  18. print newb(484,.2,.04)
Add Comment
Please, Sign In to add comment