Guest User

Untitled

a guest
Jan 21st, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. def ccOneYear(balance, annualInterestRate, monthlyPaymentRate):
  2.  
  3. Monthly_interest_rate=annualInterestRate/12.0
  4. Minimum_monthly_payment=(monthlyPaymentRate)*(balance)
  5. Total=0
  6. i=1
  7.  
  8. while(i<=12):
  9.  
  10. Total=Total+Minimum_monthly_payment
  11.  
  12. print 'Month: '+str(i)
  13.  
  14. print('Minimum monthly payment: '+str(round(Minimum_monthly_payment,2)))
  15.  
  16. balance=(balance-Minimum_monthly_payment)*(1+Monthly_interest_rate)
  17.  
  18. print('Remaining balance: '+str(round(balance,2)))
  19.  
  20. Minimum_monthly_payment=(monthlyPaymentRate)*(balance)
  21.  
  22. i=i+1
  23.  
  24. print (" ")
  25. print ("Total paid: " + str(round(Total,2)))
  26. print ("Remaining balance: " + str(round(balance,2)))
Add Comment
Please, Sign In to add comment