I am new to C# and coding in general so please forgive me. I want to use a while
loop in the default of my switch
statement but I have no clue how to setup the bool for the while
. My goal is to have the menu loop until either 1 or 2 is pressed.
switch (userChoice1)
{
case "1":
msg = "\n\nYou have chosen the House Salad with Ranch Dressing. \nPress enter to continue.";
saladChoice = "House Salad with Ranch Dressing";
break;
case "2":
msg = "\n\nYou have chosen the Caesar Salad. \nPress enter to continue. ";
saladChoice = "Caesar Salad";
break;
default:
msg = "\n\nYou have chosen an invalid option. You should have selected \n1 for the House Salad \nor \n2 for the Caesar Salad. ";
Console.Beep();
while (true) // I don't know if the switch should be in the while loop or here
{
}
break;
}