Switch statements are used, primarily, when you have logic that would otherwise be written as a long-winded conditional statement. As if-else statements become larger and more complex, they can become expensive, and often hard to read. Here is the syntax for a switch statement (borrowed from w3schools). …