0
what would be an application example of the switch
4 Answers
+ 1
A result grading
+ 1
it's just like "if else"
0
void DoCommand(string command)
{
switch (command.ToLower())
{
case "run":
DoRun();
break;
case "save":
DoSave();
break;
case "quit":
DoQuit();
break;
default:
InvalidCommand(command);
break;
}
}
- 1
great