Credit Card Program: Flowchart & C++ Code for Monthly Finance Charges & Balances, Study notes of Computer Science

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

Pre 2010

Uploaded on 08/16/2009

koofers-user-nto-1
koofers-user-nto-1 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Program 1 - Credit Card
Comp 150/170
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 t he exact same format as the example below (same spacing, spelling,
capitalization, etc.).
Initial balance? 1000
Interest rate? 12.5
Monthly charge? 50
Monthly payment? 250
Month F/C Balance
1 10.42 810.42
2 8.44 618.86
3 6.45 425.30
4 4.43 229.74
5 2.39 32.13
6 0.33 -167.54
Total finance charges: 32.46
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".
* If for some reason the credit card balance cannot be paid off, your program should report this and not produce
a table.
Turn in:
1. flowchart matching your program
2. print out of your documented program
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.

Partial preview of the text

Download Credit Card Program: Flowchart & C++ Code for Monthly Finance Charges & Balances and more Study notes Computer Science in PDF only on Docsity!

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".

  • If for some reason the credit card balance cannot be paid off, your program should report this and not produce a table.

Turn in:

  1. flowchart matching your program
  2. print out of your documented program

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.