Hi everyone, I have recently began learning C++ and have been reading and doing all the exercises in my beginners C++ book. I'm having some trouble with a particular problem and was hoping someone on this forum would be willing to offer some aid, whether it's an answer or a point in the right direction.
Here is the original MenuChooserProgram source code:
Code:// Menu Chooser // Demonstrates the switch statement #include <iostream> using namespace std; int main() { cout << "Difficulty Levels\n\n"; cout << "1 - Easy\n"; cout << "2 - Normal\n"; cout << "3 - Hard\n\n"; int choice; cout << "Choice: "; cin >> choice; switch (choice) { case 1: cout << "You picked Easy.\n"; break; case 2: cout << "You picked Normal.\n"; break; case 3: cout << "You picked Hard.\n"; break; default: cout << "You made an illegal choice.\n"; } return 0; }
Now the question is:
Rewrite the Menu Chooser program from this chapter using an enumeration to represent difficulty levels. The variable choice will still be of type int.
I know it's quite the simple problem but like I said I am new and could use a point in the right direction. I hope I can find the help I need here. Until then I'll continue to try different options.
Thank you all,
Tyler



LinkBack URL
About LinkBacks



