Programming Logic and Design, 9th Edition
Chapter 3
Review Questions
1. Snarled program logic is called code.
a. snake
b. spaghetti
c. linguini
d. gnarly
2. The three structures of structured programming are .
a. sequence, selection, and loop
b. decision, loop, and iteration
c. sequence, order, and process
d. loop, iteration, and refraction
3. A sequence structure can contain .
a. only one task
b. exactly three tasks
c. no more than three tasks
d. any number of tasks
4. Which of the following is not another term for a selection structure?
a. loop structure
b. decision structure
c. dual-alternative if structure
d. if-then-else structure
,Programming Logic and Design, 9e Solutions 3-2
5. A expression has one of two values, often expressed as true or false.
a. Georgian
b. Boolean
c. Selection
d. Caesarian
6. Placing a structure within another structure is called the
structures.
a. untangling
b. nesting
c. building
d. stacking
7. Attaching structures end to end is called .
a. nesting
b. untangling
c. building
d. stacking
8. When an action is required if a condition is true, but no action is needed if it is
false, you use a .
a. sequence
b. loop
c. dual-alternative selection
d. single-alternative selection
9. To take action as long as a condition remains true, you use a .
,Programming Logic and Design, 9e Solutions 3-3
a. sequence
b. stack
c. loop
d. selection
10. When you must perform one action when a condition is true and a different
one when it is false, you use a .
a. sequence
b. loop
c. dual-alternative selection
d. single-alternative selection
11. Which of the following attributes do all three basic structures share?
a. Their flowcharts all contain exactly three processing symbols.
b. They all begin with a process.
c. They all have one entry and one exit point.
d. They all contain a conditional test.
12. Which is true of stacking structures?
a. Two incidences of the same structure cannot be stacked adjacently.
b. When you stack structures, you cannot nest them in the same program.
c. Each structure has only one point where it can be stacked on top of another.
d. When you stack structures, the top structure must be a sequence.
13. When you input data in a loop within a program, the input statement that precedes
the loop .
a. is the only part of the program allowed to be unstructured
, Programming Logic and Design, 9e Solutions 3-4
b. cannot result in eof
c. is called a priming input
d. executes hundreds or even thousands of times in most business programs
14. A group of statements that executes as a unit is a .
a. block
b. family
c. chunk
d. cohort
15. Which of the following is acceptable in a structured program?
a. placing a sequence within the true branch of a dual-alternative decision
b. placing a decision within a loop
c. placing a loop within one of the steps in a sequence
d. All of these are acceptable.
16. In a selection structure, the structure-controlling condition is .
a. tested once at the beginning of the structure
b. tested once at the end of the structure
c. tested repeatedly until it is false
d. tested repeatedly until it is true
17. When a loop executes, the structure-controlling condition is .
a. tested exactly once
b. never tested more than once
c. tested either before or after the loop body executes
d. tested only if it is true, and not asked if it is false