8 Feb 2015

Receipt of Credit Card

#Python

#Program to calculate receipt of a Credit Card

balance = 4842
annualInterestRate = 0.2
monthlyPaymentRate = 0.04
totalPaid=0.0
 
i=1
while(i<=12):
    monthlyInterestRate=annualInterestRate/12.0
    minimumMonthlyPay=monthlyPaymentRate*balance
    monthlyUnpaidBal=balance-minimumMonthlyPay
    balance=monthlyUnpaidBal+monthlyInterestRate*monthlyUnpaidBal
    totalPaid+=minimumMonthlyPay
    print "Month:", i
    print "Minimum monthly payment:", round(minimumMonthlyPay,2)
    print "Remaining balance:", round(balance,2)
    i+=1
 
print "Total paid:", round(totalPaid,2)
print "Remaining balance:", round(balance,2)   

Categories: , ,

Related Posts:

  • The 6.00 Word Game # Python # The 6.00 Word Game # Problem Set 4A   from ps4a import *import time# Problem #6: Computer chooses a worddef compChooseWord(hand, wordList, n):    """    Given a hand and a wordL… Read More
  • Hangman game # Python # Problem Set 3 # Hangman game import randomimport stringWORDLIST_FILENAME = "words.txt"def loadWords():    """    Returns a list of valid words. Words are strings of lowercase le… Read More
  • Minimum Monthly Payment of Credit Card using Bisection Search #Python ''' Program to calculate minimum Monthly Payment of a Credit Card using Bisection Search ''' balance = 320000annualInterestRate = 0.2newbalance=balancei=1monthlyInterestRate=annualInterestRate/12.0lowerb=newbalan… Read More
  • Quiz #Python #Quiz   #Problem 4 def myLog(x, b):    '''    x: a positive integer    b: a positive integer; b >= 2    returns: log_b(x), or, the logarithm … Read More
  • The 6.00 Word Game #Python   # 6.00x Problem Set 4A# The 6.00 Word Gameimport randomimport stringVOWELS = 'aeiou'CONSONANTS = 'bcdfghjklmnpqrstvwxyz'HAND_SIZE = 7SCRABBLE_LETTER_VALUES = {    'a': 1, 'b': 3, 'c': 3, 'd': 2,… Read More

1 comment:

  1. I am very much pleased with the contents you have mentioned. I wanted to thank you for this great article. Need credit collection services commercial? Visit dlrcollectionagency.com

    ReplyDelete

Copyright © 2025 UPgradeCODING | Powered by Blogger