I need help with the first exercise on chapter 2.
here is the exercise:Rewrite the Menu Chooser program using an enumeration to represent the difficulty levels. The variable choice will still be of type int.
original Menu Chooser:
{
cout << "Choose your difficulty level\n\n";
cout << "1-Easy\n";
cout << "2-Normal\n";
cout << "3-Hard\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;
}
Menu chooser with enumerations:
}cout << "Choose your difficulty level\n\n";
cout << "1-Easy\n";
cout << "2-Normal\n";
cout << "3-Hard\n";