help me please

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 3
Reputation: nano99r is an unknown quantity at this point 
Solved Threads: 0
nano99r nano99r is offline Offline
Newbie Poster

help me please

 
0
  #1
Sep 10th, 2008
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”;
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,844
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: help me please

 
0
  #2
Sep 10th, 2008
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum


Views: 312 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC