Chapter 5: Engineering Review

25 July 2022
4.7 (114 reviews)
35 test answers

Unlock all answers in this set

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