Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- balance = float(raw_input('Enter the outstanding balance on the credit card: '))
- annualRate = float(raw_input('Enter the annual interest rate on the credit card: '))
- minPaymentRate = float(raw_input('Enter the minimum monthly payment rate on the credit card: '))
- print("\n")
- monthly_rate = annualRate/12
- print("\n")
- months = int(0)
- minMonPay = float (0) #minimum monthly pay
- intsPaid = float (0) #interests paid
- principalPaid = float(0)
- totalAmountPaid = float(0)
- while months<12:
- months = months+1
- print 'month:', months
- minMonPay = (minPaymentRate * balance)
- print 'minimum monthly payment:', '$', round(minMonPay, 2)
- intsPaid = monthly_rate * balance
- principalPaid = minMonPay - intsPaid
- print 'principal Paid', '$', round(principalPaid, 2)
- balance = (balance - (principalPaid))
- balanceStr = str(balance)
- print 'remaining balance', '$', round(balance, 2)
- totalAmountPaid = (totalAmountPaid + minMonPay)
- print("\n")
- print "RESULT\n"
- print 'remaining balance', '$', round(balance, 2)
- print '$', 'Total amount paid', round(totalAmountPaid, 2)
Advertisement
Add Comment
Please, Sign In to add comment