Chapter 3 Flashcards
When a loop executes, the structure-controlling condition is ______________.
tested either before or after the loop body executes
Attaching structures end to end is called ______________.
stacking
Which of the following attributes do all three basic structures share?
They all have one entry and one exit point.
Which of the following is not a benefit of modularizing programs?
If you use modules, you can ignore the rules of structure.
In a selection structure, the structure-controlling condition is ______________.
tested once at the beginning of the structure
Which of the following is true of structured logic?
Any task can be described using some combination of the three structures: sequence, selection, and loop.
When an action is required if a condition is true, but no action is needed if it is false, you use a ______________.
single-alternative selection
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 loop within one of the steps in a sequence
c. All of these are acceptable.**
d. placing a decision within a loop
Which of the following is not another term for a selection structure?
loop structure
Placing a structure within another structure is called the ______________ structures.
nesting
Which of the following is not a reason for enforcing structure rules in computer programs?
Structured programs usually are shorter than unstructured ones.
A sequence structure can contain ______________.
any number of tasks
A ______________ expression has one of two values, often expressed as true or false.
Boolean
Snarled program logic is called ______________ code.
spaghetti
Which is true of stacking structures?
Each structure has only one point where it can be stacked on top of another.
When you input data in a loop within a program, the input statement that precedes the loop ______________.
is called a priming input
A group of statements that executes as a unit is a ______________.
block
When you must perform one action when a condition is true and a different one when it is false, you use a ______________.
dual-alternative selection
The three structures of structured programming are ______________.
sequence, selection, and loop
To take action as long as a condition remains true, you use a ______________.
loop