Additional Control Structures
In this lab, we will review while loops and introduce two new forms of
loop. You will also learn the switch case statement.
Here is a list showing what you need to learn:
- Using
for
loops as counting loops - Using
do-while
event controlled loops when you want to run the loop at least once - Correctly use
case
anddefault
labels andbreak
statements as part ofswitch
statements.
You have a choice of doing Exercises 1 to 3, or Exercise 4.