SHARE
TWEET

Untitled

a guest Jan 18th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     balance = 4213
  2.     annualInterestRate = 0.2
  3.     monthlyPaymentRate = 0.04
  4.    
  5.     monthlyInterestRate = (annualInterestRate/12)
  6.     minimumMonthlyPayment = 0
  7.     interest = 0
  8.     payment = 0
  9.     output = 0
  10.     totalpaid = 0
  11.     i = 0
  12.    
  13.     while i<12:
  14.         minimumMonthlyPayment = monthlyPaymentRate * balance
  15.         payment = (balance * minimumMonthlyPayment)
  16.         interest = (balance - payment) * (annualInterestRate/12)
  17.         balance = (balance - payment) * (1 + (annualInterestRate/12))
  18.         month = i + 1
  19.         test1 = round(payment, 2)
  20.         test2 = round(balance, 2)
  21.         print('Month: ' + str(month))
  22.         print('Minimum monthly payment: ' + str(test1))
  23.         print('Remaining balance: ' + str(test2))
  24.         totalpaid = totalpaid + payment
  25.         i = i + 1
  26.     print('.')
  27.     print('Total paid: ' + str(round(totalpaid, 2)))
  28.     print('Remaining balance: ' + str(round(balance, 2)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top