8.1 Why Use a switch Statement?
For a small number of logical evaluations of a value the if ... else if ... construct is perfectly adequate. Unfortunately, any more than two or three possible scenarios can quickly make such a construct both time consuming to write and difficult to read. For such situations, the switch statement provides an excellent alternative.