Code:
//Chapter 2 - question 2
//Menu Chooser Program using enumeration
#include <iostream>
using namespace std;
int main()
{
int choice;
enum difficulty {EASY = 1, NORMAL, HARD};
difficulty myDifficulty;
myDifficulty == choice;
cout << "Difficulty Levels: \n\n";
cout << "1 - Easy.\n";
cout << "2 - Normal.\n";
cout << "3 - Hard.\n";
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";
}
system ("pause");
return 0;
}
this seems to work. sorry if it's messy I just threw it together.