Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python Goals: Developing problem-solving skills, using loops and value returning functions Problem: You have been asked to write a program that will help users

Using Python

Goals: Developing problem-solving skills, using loops and value returning functions

Problem: You have been asked to write a program that will help users estimate credit card payments and interest paid. Your program will ask the user to enter the yearly interest rate for the credit card as a percentage, then will repeatedly ask the user to re-enter the rate when the user entered a yearly interest rate less than 1% or greater than 30%.

Next, a loop should be employed that outputs the previous balance; calculates and outputs the monthly interest on the previous balance; asks the user to enter new charges and confirms the new charges are greater than 0 ;calculates and outputs the current balance (previous balance + monthly interest + new charges); calculates and outputs the minimum payment due; asks the user to input a payment; calculates a new current balance. The minimum payment due is the larger of 7.5% times the current balance or $10.00. If the current balance is less than $10.00, the minimum payment is the current balance. The user must make a payment greater than or equal to the minimum payment. The payment is then subtracted from the current balance to determine the balance for the next month. This loop should continue as long as the user still owes on his/her credit card.

After the loop is finished, the program should output the total interest paid. Also if the user paid more than the current balance, then a credit should be output.

Your program should utilize a built-in function that can round amounts to the nearest cent. This function should be called used in the loop, once to round the interest to the nearest cent and once to round the minimum payment to the nearest cent.

Output of all currency amounts should be to 2 decimal places.

Hint: initially set the balance from the previous month and the interest applied from the previous month to 0. Do not use concepts beyond Chapter 6 of your textbook and make sure you allow user to enter invalid data again, not just end the program.

Do not use any built-in functions other than those for formatting and rounding. Remember that your introductory comments should describe the problem without reference to any material outside the program.

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

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions