C++ help

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

Join Date: Jun 2005
Posts: 1
Reputation: white_eyez is an unknown quantity at this point 
Solved Threads: 0
white_eyez white_eyez is offline Offline
Newbie Poster

C++ help

 
0
  #1
Jun 9th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,461
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 254
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: C++ help

 
0
  #2
Jun 9th, 2005
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;
}
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
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: 1287 | 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