944,098 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1387
  • C++ RSS
Jun 9th, 2005
0

C++ help

Expand Post »
Now we are doing pseudocode and looping.On my assignment I believe i should do a sentinel controlled loop?
But i really don't know.It says this:
Develop an MC++ application that will determine if a department store customer has exceeded the limit on a charge account.For each customer,the following facts are available:a)Account number
b)Balance at the beginning of the month
c)Total of all items charged by this customer
d)Total of all credits applied to this customer's account this month
e)Allowed credit limit
Hint:Users should input as integers each of these facts,calculate the new balance (=beginning balance + charges - credits), display the new balance and determine if the new balance exceeds the customer's credit limit.For those customers whose credit limit is exceeded,the program should display the message,"Credit limit exceeded"....the credit limit is 400
#include "stdafx.h"
#using <mscorlib.dll>
using namespace system
Reputation Points: 10
Solved Threads: 0
Newbie Poster
white_eyez is offline Offline
1 posts
since Jun 2005
Jun 9th, 2005
0

Re: C++ help

Hmm. Something like this?
credit_limit = 400;
credit_total = 0;
balance = 0;
charges_remaining = something;
while ( charges_remaining )
{
   charges = get_charges();
   credits = get_credits();
   balance = balance + charges - credit
   if ( credit_total > credit_limit )
   {
      error_message();
   }
   charges = charges - 1;
}
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004

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: Printing a Queue to file
Next Thread in C++ Forum Timeline: Function templates question





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


Follow us on Twitter


© 2011 DaniWeb® LLC