Quiz
The following questions will test your knowledge of loops. In the spirit of the subject matter, repeat each of these until you get them right.
Questions
1: |
What must be used to separate each section of a for statement?
- Commas
- Semicolons
- Off-duty police officers
|
2: |
Which statement causes a program to go back to the statement that began a loop and then keep going from there?
|
3: |
When it comes to borrowing a car from your father, what lesson did you learn during this hour?
- Don't even think about it.
- Speak softly and carry a big stick.
- It's better to beg forgiveness than to ask permission.
|
Answers
A1: |
b. Commas are used to separate things within a section, but semicolons separate sections.
|
A2: |
a. The break statement ends a loop entirely, and continue skips to the next go-round of the loop.
|
A3: |
c. Though I'm not sure my father has completely forgiven me for that incident in 1987.
|
|