Questions for Chapter 7
1) Unless nested within a repeating control structure, Do in order, Do together, and If/Else
control statements are expected to be executed exactly how many times?
2) Give two examples of control structures that are generally expected to execute
repeatedly.
3) Give a reason for describing the Loop statement as a counted loop.
4) If a block of program code is composed of nested Loop statements and the outer loop
count is 3 and the inner loop count is 5, how many times does the inner loop execute?
5) A Loop in which the count is infinity must of course, eventually stop. What action
triggers the stop of a so-called infinite loop?
6) What distinguishes a Loop control construct from a While control construct, in terms of
what is known about the number of times a block of code will be repeated?
7) Conditional expressions used in a While statement have the same components as
conditional expressions used in what other control construct?
8) Although in some programs a While statement should be infinite, in most programs a
While statement should eventually end. How can you make sure a While statement will
eventually end?
9) Is it possible that the instructions within a While statement might never be executed at
all? If not, explain why not. If so, give an example.
10) The Begin-During-End event is a variation on what kind of repetition control construct?
11) Exercise 3 below includes a textual storybook. Sketch a flowchart for the loop.