More Examples of the switch Statement
In this lesson, we will look at examples of the switch statement with a character or an enumerated data type.
We'll cover the following...
We'll cover the following...
Character values with a switch statement
The action of a switch statement can be based upon a character. For example, if the char variable grade contains a letter grade, the following switch statement assigns the correct number of quality points to the double variable qualityPoints: