How to program this?

Make and run a program that asks the user to type A,B,C or Q. When the user types Q, the program ends. When the user types A,B,C, the program displays the message "good Job" and then ask for another input. When the user types anything else, issue an error message and then ask for another input. (looping)
Do you have any code written so far? I would use a while loop and a break or continue statement when 'Q' is entered.
[code]
int main () {

getMenuChoice = menuSwitch();

do {
switch(getMenuChoice) {
case A: //do something;

getMenuChoice = menuSwitch();
break;
case B: //do something
;
getMenuChoice = menuSwitch();
break;
case C: //do something

getMenuChoice = menuSwitch();
break;

}
} while (getMenuChoice != Q);
return 0;
}

int menuSwitch (void) {

int switchCount = 0;
cin >> switchCount;
while(switchCount != A && switchCount != B && switchCount != C) {
cout << "\n\t\tWRONG OPTION! Please select option (A), (B), or (C)." <<endl;

cin >> switchCount;
}
return switchCount;
}
doesn't have yet.
All i need is the whole program.
Yeah, well you're not going to get it. Do your own homework. If you can't at least put in the effort to solve it yourself, then you deserve an F in the class.
Topic archived. No new replies allowed.