Advertisement
superpawko

Untitled

Sep 26th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. balance = 4773
  2. annualInterestRate = 0.2
  3.  
  4. def remainingBalance(balance, annualInterestRate):
  5. minimumFixPayment=10
  6. #balanceTemp=0
  7.  
  8.  
  9. def remiaingBalanceHelp(balance, annualInterestRate, month=1):
  10.  
  11. if month == 13:
  12. print("Balance :" + str(round(balance, 2)) + " MinFixPay : " + str(minimumFixPayment))
  13. return balance
  14.  
  15. else:
  16. monthlyInterest = annualInterestRate / 12
  17. unpaidBalance = balance - minimumFixPayment
  18. monthBalance = unpaidBalance + monthlyInterest * unpaidBalance
  19.  
  20. #print("Month %d Remaining balance: %.2lf" % (month, monthBalance))
  21. return remiaingBalanceHelp(monthBalance, annualInterestRate, month+1)
  22.  
  23.  
  24. while remiaingBalanceHelp(balance, annualInterestRate, month=1) >0:
  25. #print("BALANCE TYPE :" + str(balanceTemp))
  26. #print("1 " + " Balance :" + str(round(balanceTemp, 2)))
  27. if remiaingBalanceHelp(balance, annualInterestRate, month=1) > 1000:
  28. #print("HIGH BALANCE")
  29. minimumFixPayment += 200
  30. else:
  31. minimumFixPayment += 10
  32. return minimumFixPayment
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. print("Lowest Payment: %i " % remainingBalance(balance, annualInterestRate))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement