• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

c++ HELP NEEDED

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
dedcar
Asked:
dedcar
1 Solution
 
SalteCommented:
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
 
tinchosCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now