HTML and CSS Reference
In-Depth Information
Figure 6.9
Using a label with a loop.
“Two roads diverged in a wood, and I—” wrote Robert Frost. This chapter was about
making decisions about the flow of your program, what road to take, how to repeat a
sequence of statements, and how to stop the repetition. At this point, you should under-
stand:
1. How to use conditional constructs to control the flow of your program;
if/else
,
switch
, and so on.
2. What a block is and when to use curly braces.
3. How and why you would use a
switch
statement.
4. How the
while
and the
do/while
loops differ.
5. How to use a
for
loop.
6. How to use
break
and
continue
with loops.
7. The purpose of nested loops.
8. How to make an infinite loop and how to get out of it.
9. The purpose of labels in loops.
10. How
else/if
s work.