Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ccOneYear(balance, annualInterestRate, monthlyPaymentRate):
- Monthly_interest_rate=annualInterestRate/12.0
- Minimum_monthly_payment=(monthlyPaymentRate)*(balance)
- Total=0
- i=1
- while(i<=12):
- Total=Total+Minimum_monthly_payment
- print 'Month: '+str(i)
- print('Minimum monthly payment: '+str(round(Minimum_monthly_payment,2)))
- balance=(balance-Minimum_monthly_payment)*(1+Monthly_interest_rate)
- print('Remaining balance: '+str(round(balance,2)))
- Minimum_monthly_payment=(monthlyPaymentRate)*(balance)
- i=i+1
- print (" ")
- print ("Total paid: " + str(round(Total,2)))
- print ("Remaining balance: " + str(round(balance,2)))
Add Comment
Please, Sign In to add comment