The loop control variable is initialized after entering the loop. (T/F) |
False |
In some cases, a loop control variable does not have to be initialized. (T/F) |
False |
An indefinite loop is a loop that never stops. (T/F) |
False |
You can either increment or decrement the loop control variable. (T/F) |
True |
When one loop appears inside another is called an indented loop. (T/F) |
False |
Forgetting to initialize and alter the loop control variable is a common mistake that programmers sometimes make. (T/F) |
True |
Every high-level computer programming language contains a while statement. (T/F) |
True |
Both the while loop and the for loop are examples of pretest loops. (T/F) |
True |
The safest action is to assign the value 1 to accumulators before using them. (T/F) |
False |
It is the programmer’s responsibility to initialize all variables that must start with a specific value. (T/F) |
True |
The first step in a while loop is typically to _______. |
Initialize the loop control variable |
Once your logic enters the body of a structured loop, _______. |
The entire loop must execute |
The last step in a while loop is usually to ____. |
Increment the loop control variable |
A(n) _____ loop executes a predetermined number of times. |
Definite |
Many loop control variable values are altered by ______________, or adding to them. |
Incrementing |
An _____ is any numeric variable you use to count the number of times an event has occurred. |
Counter |
A loop within another loop is known as an _________ loop. |
Nested |
When one loop appears inside another, the loop that contains the other loop is called the _____ loop. |
Outer |
Usually, when you create nested loops, each loop has it’s own _________________. |
Loop control variable |
A mistake programmers often make with loops is that they _______. |
Include statements inside the loop that belong outside the loop |
A mistake programmers often make with loops is that they _______________. |
Neglect to initialize the loop control variable prior to entering the loop body |
A comparison is correct only when the correct ______ and operator are used. |
Operands |
Programmers use the term ________ to describe programs that are well designed and easy to understand the maintain. |
Elegant |
You usually use the for loop with ________ loops. |
Definite |
The ________ loop provides three actions in one compact statement. |
For |
The amount by which a for loop control variable changes is often called a ___________ value. |
Step |
In a ________, the loop body might never execute because the question controlling the loop might be false the first time it is asked. |
Pretest loop |
In a _________, the loop body executes at least one time because the loop control variable is not tested until after one iteration. |
Posttest loop |
The ____ loop is particularly useful when processing arrays. |
For |
An _____ is a very similar to a counter that you use to count loop iterations, expect that usually add a value other than one to this type of variable. |
Accumulator |
_______ is a technique with which you try to prepare for all possible errors before they occur. |
Defensive programming |
Business reports that list only totals, with no individual items= details, are called __________. |
Detail Reports |
Loops are frequently used to ______; that is, to make sure it is meaningful and useful. |
Validate data |
Programmers employ the acronym __________ to mean that if your input is incorrect, your output is worthless. |
GIGO |
__________ a data item means you override incorrect data by setting the variable to specific value. |
Forcing |
Chapter 5 Review
Share This
Unfinished tasks keep piling up?
Let us complete them for you. Quickly and professionally.
Check Price