Hi, I have to create this program and I am having difficulty doing it.
Develop a Visual C++ program that will determine whether a department-store customer
has exceeded the credit limit on a charge account. For each customer, the following facts are entered via a keyboard:
a. Account number (an integer)
b. Balance at the beginning of the month (a double)
c. Total of all items charged by this customer this month (a double)
d. Total of all credits applied to this customer's account this month (a double)
e. Allowed credit limit (a double)

The program should calculate the new balance = (beginning balance + charges – credits) and determine whether the new balance exceeds the customer’s credit limit. For those customers whose credit limit is exceeded, the program should display the customer's account number, credit limit, new balance and the message “Credit Limit Exceeded.”

Additional Specifications
1. Use “prompts” so that the user knows what to expect, what to do, and how to do it. For example:
Enter Account Number:

2. Use an appropriate data type for each variable (i.e., integer data type for Account Number, double data type for Beginning Balance, etc.)

3. The program should display the output on the screen. The output should look like the following (the numbers in bold are typed by the user):
a. First run: New balance is greater than the Credit limit
Enter account number: 100
Enter beginning balance: 5394.78
Enter total charges: 1000.00
Enter total credits: 500.00
Enter credit limit: 5500.00
New balance is 5894.78
Account: 100
Credit limit: 5500.00
Balance: 5894.78
Credit Limit Exceeded.
b. Second run: New balance is less than the Credit limit.
Enter Account Number: 200
Enter beginning balance: 1000.00
Enter total charges: 123.45
Enter total credits: 321.00
Enter credit limit: 1500.00
New balance is 802.45

4. You will need to include the header files:
<iostream> for the data stream cout and cin
<iomanip> for the input/output manipulators.

5. To display the content of a variable, newBalance, with two digits after decimal point:
std::cout << “New balance is “ << std::setprecision(2) << std::fixed << newBalance << “\n”;

This article has been dead for over six months. Start a new discussion instead.