Programming Chapter 5

25 July 2022
4.7 (114 reviews)
20 test answers

Unlock all answers in this set

Unlock answers (16)
question
You usually use the for loop with ____ loops.
answer
definite
question
The loop control variable is initialized after entering the loop.
answer
False
question
Both the while loop and the for loop are examples of pretest loops.
answer
True
question
A(n) ____ loop executes a predetermined number of times.
answer
definite
question
The amount by which a for loop control variable changes is often called a ____ value.
answer
step
question
In some cases, a loop control variable does not have to be initialized.
answer
False
question
Use a counter or a(n) ____ to control a loop's repetitions.
answer
sentinel value
question
When one loop appears inside another, the loop that contains the other loop is called the ____ loop.
answer
outer
question
Usually, when you create nested loops, each loop has its own ____.
answer
loop control variable
question
You can either increment or decrement the loop control variable.
answer
True
question
Every high-level computer programming language contains a while statement.
answer
True
question
____a data item means you override incorrect data by setting the variable to a specific value.
answer
Forcing
question
In a ____, the loop body might never execute because the question controlling the loop might be false the first time it is asked.
answer
pretest loop
question
A comparison is correct only when the correct ____ and operator are used.
answer
operands
question
Many loop control variable values are altered by ____, or adding to them.
answer
Incrementing
question
The ____ loop provides three actions in one compact statement.
answer
for
question
A mistake programmers often make with loops is that they ____.
answer
neglect to initialize the loop control variable prior to entering the loop body
question
An indefinite loop is a loop that never stops.
answer
False
question
The safest action is to assign the value 1 to accumulators before using them.
answer
False
question
A mistake programmers often make with loops is that they ____.
answer
include statements inside the loop that belong outside the loop