COP1000C Quiz#5 Multiple Choice

24 July 2022
4.7 (114 reviews)
25 test answers

Unlock all answers in this set

Unlock answers (21)
question
Initialize the loop control variable
answer
The first step in a while loop is typically to ____.
question
The entire loop body must execute
answer
Once your logic enters the body of a structured loop, ____.
question
Sentinel value
answer
Use a counter or a(n) ____ to control a loop's repetitions.
question
Definite
answer
A(n) ____ loop executes a predetermined number of times.
question
Incrementing
answer
Many loop control variable values are altered by ____ or adding to them.
question
Counter
answer
A(n) ____ is any numeric variable you use to count the number of times an event has occurred.
question
Nested
answer
A loop within another loop is known as a(n) ____ loop.
question
Outer
answer
When one loop appears inside another, the loop that contains the other loop is called the ____ loop.
question
Loop control variable
answer
Usually, when you create nested loops, each loop has its own ____.
question
Include statements inside the loop that belong outside the loop
answer
A mistake programmers often make with loops is that they ____.
question
Neglect to initialize the loop control variable prior to entering the loop body
answer
A mistake programmers often make with loops is that they ____.
question
Operands
answer
A comparison is correct only when the correct ____ and operator are used.
question
Elegant
answer
Programmers use the term ____ to describe programs that are well designed and easy to understand and maintain.
question
Definite
answer
You usually use the for loop with ____ loops.
question
For
answer
The ____ loop provides three actions in one compact statement.
question
Step
answer
The amount by which a for loop control variable changes is often called a ____ value.
question
For
answer
The ____ loop is particularly useful when processing arrays.
question
Pretest loop
answer
In a ____, the loop body might never execute because the question controlling the loop might be false the first time it is asked.
question
Posttest loop
answer
In a ____, the loop body executes at least one time because the loop control variable is not tested until after one iteration.
question
Accumulator
answer
A(n) ____ is very similar to a counter that you use to count loop iterations, except that you usually add a value other than one to this type of variable.
question
Summary reports
answer
Business reports that list only totals, with no individual item details, are called ____.
question
Defensive programing
answer
____ is a technique with which you try to prepare for all possible errors before they occur.
question
Validate data
answer
Loops are frequently used to ____; that is, to make sure it is meaningful and useful.
question
GIGO
answer
Programmers employ the acronym ____ to mean that if your input is incorrect, your output is worthless.
question
Forcing
answer
____ a data item means you override incorrect data by setting the variable to a specific value.