Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# Write program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the #

# Write program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the

# credit card company each month.

# The following variables contain values as described below:

# balance - the outstanding balance on the credit card

# annualInterestRate - annual interest rate as a decimal

# monthlyPaymentRate - minimum monthly payment rate as a decimal

# For each month, calculate statements on the monthly payment and remaining balance. At the end of 12 months, print out the remaining

# balance. Be sure to print out no more than two decimal digits of accuracy - so print

# Remaining balance: 813.41

# instead of

# Remaining balance: 813.4141998135

# So your program only prints out one thing: the remaining balance at the end of the year in the format:

# Remaining balance: 4784.0

# A summary of the required math is found below:

# Monthly interest rate= (Annual interest rate) / 12.0

# Minimum monthly payment = (Minimum monthly payment rate) x (Previous balance)

# Monthly unpaid balance = (Previous balance) - (Minimum monthly payment)

# Updated balance each month = (Monthly unpaid balance) + (Monthly interest rate x Monthly unpaid balance)

# Paste your code into this box

for i in range(12):

balance = balance - (balance * monthlyPaymentRate) + ((balance - (balance * monthlyPaymentRate)) * (annualInterestRate/12))

print("Remaining balance:", round(balance, 2))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions