I am currently doing an assignment for one of my programming units and I am required to use switch statements do display a menu and collect data. I seem to have worked out the switch statement itself, but I am wondering how I return the user to the menu once a case has executed?
For example :
Console.writeline("Enter Customer Details (s) ");
Console.writeline("Enter usage data (u) ");
Console.writeline("Display usage data (d) ");
menu = console.readline();
switch (menu)
case 's':
statement
break;
case 'u':
statement
break;
case 'd':
statement
break;
default :
statement
break;
Now, let's say the user wants to enter the Usage data first, how do I return them to the 'menu' so they can opt to enter customer details and/or display the data.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…