943,807 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 440
  • C++ RSS
Sep 10th, 2008
0

help me please

Expand Post »
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”;
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nano99r is offline Offline
3 posts
since Sep 2008
Sep 10th, 2008
0

Re: help me please

Featured Poster
Reputation Points: 2614
Solved Threads: 687
Posting Expert
VernonDozier is offline Offline
5,374 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: 2D arrays and strtok
Next Thread in C++ Forum Timeline: Return an array of strings





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC