?
Solved

c++ HELP NEEDED

Posted on 2003-03-28
3
Medium Priority
?
205 Views
Last Modified: 2010-04-01
Need ideas for producing a program in c++ to do the following
1. Telephone numbers have to be entered into prog and validated as National Call, Local Call or Overseas Call.

2. Add money/credit.

3. As phone is connecting a message has do be displayed saying " please wait until we try and connect you" when connected "you are now connected to (number) please start your conversation" has to be displayed.

4. Also a timer to countdown total money/credit,which has been input by the user, when it reaches zero a message is displayed saying
"no credit left your call is disconnected".


Its kinda like a telephone box!
Any ideas would be greatly appreciated.

From T.Green
0
Comment
Question by:dedcar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
Salte earned 80 total points
ID: 8225964
This program sounds like homework and it is against EE policy to allow the experts to do your homework for you.

I can give you some ideas though.

Sounds to me like it is a simple statemachine. Start in a state and based on a state you perform some action, asking for telephone number etc etc.

Based on the input you go to a new state, which state you go to depends on the input.

Then you simply make a loop:

while (state != done) {
   branch on state and do an action based on state.
   if the action require user input, prompt the user,
   read the input and use the input to determine next
   state.
}

'done' is a special state that marks that the program is over.

That is how _I_ would have solved this problem.

Alf
0
 
LVL 9

Expert Comment

by:tinchos
ID: 9566392
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: Salte

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question