I recently created a program that will create a math problem based on the user input. By entering either 1-4 the program can generate a problem or the user can quit by ente
Actually, forget about step 2. Just check whether it was one of the digit characters you actually want ('1', '2', '3', '4', '5'):
char choice;
while(cin.get(choice)){
if(choice == '5')
break;
switch(choice){
default: printWrongCharacterMessage(); break;
case '1': do1Stuff(); break;
case '2': do2Stuff(); break;
case '3': do3Stuff(); break;
case '4': do4Stuff(); break;
}
}