
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A programming assignment where students are required to write a c++ program and create a flowchart to calculate the monthly finance charge and balance of a credit card given initial balance, apr, monthly charge, and monthly payment. The program should produce a table showing the finance charge and balance for each month until the card is paid off, displaying the total finance charges at the end. Instructions on how to format the output and handle invalid input.
Typology: Study notes
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Program 1 - Credit Card Comp 150/ 50 Points
Write a flowchart and C++ program which will calculate the monthly finance charge and monthly balance of a credit card given the initial balance, the credit card's APR, the monthly amount charged to the card, and the monthly payment made on the card. The program will produce a table like the one below, stopping once the credit card has been paid off (balance less than or equal to 0). The total of all the finance charges will be displayed after the table.
The finance charge (F/C) is computed as the account balance times the MPR before the month's charges or payments are made.
Your program should produce output in the exact same format as the example below (same spacing, spelling, capitalization, etc.).
Initial balance? 1000 Interest rate? 12. Monthly charge? 50 Monthly payment? 250
Month F/C Balance 1 10.42 810. 2 8.44 618. 3 6.45 425. 4 4.43 229. 5 2.39 32. 6 0.33 -167.
Total finance charges: 32.
The user may enter any positive dollar amount, interest rate, monthly charge, or monthly payment. Make sure your program works with all acceptable input; there shouldn’t be any infinite loops. Don’t worry about negative values being entered.
To create the aligned columns, you will need to use the setw function in the iomanip.h library. There are 7 spaces between "Month" and "F/C" and 5 spaces between "F/C" and "Balance".
Turn in:
Submit your program to Easel (http://cs.harding.edu/easel/) before class on the due date.
Make sure your flowchart and program match-up exactly! Half of the points will be based on how well the program runs and how the program is written (good variable names, proper indentation, etc.). The other half will be based on how correctly the flow chart and code match-up.