Module 5 · Decisions
switch, case and Fall Through
Free with an accountReading
David wrote the menu for his café's order screen: 1 for tea, 2 for coffee, 3 for juice. A customer pressed 2.
Sign in to read
This lesson is free, with an account
An account costs nothing and opens every lesson in this track that is not marked Pro, on every device you read on.
What is inside switch, case and Fall Through
- switch: one value, many constants
- break, and what happens without it
- default, and where it goes
- Grouping cases, and switching on a char
- Fall through on purpose, with a comment
- What switch cannot test
- switch or an else if ladder?