Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Created on Wed Jan 17 07:29:04 2018
- @author: user
- """
- #PSet2_Peoblem 2
- balance = 42
- annualInterestRate = 0.2
- monthlyPaymentRate = 0.04
- #these 3 values above are to be defined by the grader
- # resut to be KEPT and month to be DELETED when posting
- result = 0
- month = 0
- for i in range(12):
- monthlyInterestRate = (annualInterestRate)/12.0
- minimumMonthlyPayment = monthlyPaymentRate * balance
- monthlyUnpaidBalance = balance - minimumMonthlyPayment
- updatedBalance = monthlyUnpaidBalance + (monthlyInterestRate * monthlyUnpaidBalance)
- result += minimumMonthlyPayment
- balance = updatedBalance
- month += 1
- print('Month' + str(month) + 'Remaining balance:' + str(round(result, 2)))
- print('Remaining balance:' + str(round(result, 2)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement