We start with the word "switch", then the thing we're switching upon enclosed in round parentheses, and then open a curly-bracket to help delimit the extent of the switch-statement.
For each possible outcome, we use the word "case", the value we want to test against, then a colon and the statements we want executed.
Switch can only work on the basis of equality -- there's an implied "==" operator for each case. You can't use greater-than or less-than.
At the end of the whole switch, we close the curly-bracket.
|
|