Hi Everyone,
I am taking C++ for the second time and I am understanding it better this time around. I have an assignment that needs a switch (got that, know how to do it), I have put if/else statements inside of the cases. The thing I can't get to work is:
1. If the user enters the incorrect case (i.e. any letter besides a, b, or c) before going to the default it will jump to my next cout statement, then it prompts for the user to re-enter the correct letter, after that it ends. So I need advice on how to get it to stop asking for the hours used after the wrong input, and I need it to continue to run after the correct input is re-entered. I hope that I haven't confused anyone to bad. I have the code wrote, but am not real sure what I can or can't post or even how it is to be posted. Also we are using jGrasp with the cygwin compiler. Thanks.
Recommended Answers
Jump to Postalright... alright... jeje...
it had been a long time since i got you mad at me huh narue?
Jump to Post>it had been a long time since i got you mad at me huh narue?
If you want to get me mad, keep using jeje. It's a big pet peeve of mine. I used to play a game called X-wing vs. Tie Fighter and was actually one of the better …
Jump to Posti'm sorry... please don't stop talking to me... :P
it's just that i'm used to laugh like that... but i'll do my best... okay?
Jump to Posti guess your mistake is not using break; after each case... if you don't do this, your switch will run all the way until all the cases are done...
another thing i would advise you to do is use the default until the end of the switch statement, since this …
Jump to Post> Seems to me, that this is more a a gossip forum, than a help forum.
You are the only one with this kind of opinion I guess.> I came here for help and advice.
If you still haven't been able to find those, then you are not …
All 25 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.