Ch 5 Quiz
An ... is a variable that is initialized to some starting value, usually zero, and then has numbers added to it in each iteration of a loop.
Accumulator
The statement or block that is repeated is known as the ... of the loop.
Body
The ... statement causes a loop to terminate immediately.
Break
The ... statement causes a loop to skip the remaining statements in the current iteration.
Continue
A ... is a variable that ¨counts¨the number of times a loop repeats.
Counter
In a nested loop, the outer loop executes faster than the inner loop.
False
It is not necessary to initialize counter variables.
False
One limitation of the for loop is that only one variable may be initialized in the initialization expression.
False
The break statement causes the loop to stop the current iteration and begin the next one.
False
The continue statement causes a terminated loop to resume.
False
The do while loop is a pretest loop.
False
The for loop is a posttest loop.
False
The operand of the increment and decrement operators can be any valid mathematical expression.
False
To calculate the total number of iterations of a nested loop, add the number of iterations of all the loops.
False
The ... loop always iterates at least once.
For
The ... loop is ideal for situations that require a counter.
For
To ... a value means to increase by one, and to .. a value means to decrease by one.
Increment, decrement
A loop that does not have a way of stopping is an ... loop.
Infinite
Inside the for loop´s parenthesis, the first expression is the ... the second is the ... and the third is the ...
Initialization, test, update
Each repetition of a loop is known as an ... .
Iteration
A loop that is inside another loop is called a ... loop.
Nested
When the increment or decrement operator is placed after the operand, to the right, the operator is being used in ... mode.
Postfix
A loop that evaluates its expression after each repetition is a ... loop.
Posttest
When the increment or decrement operator is placed before the operand, to the left, the operator is being used in ... mode.
Prefix
A loop that evaluates its test expression before each repetition is a ... loop.
Pretest
A ... is a sun of numbers that accumulates with each iteration of a loop.
Running total
A ... is a special value that marks the end of a series of values.
Sentinel
A variable may be defined in the initialization expression of a loop.
True
All three of the for loops expressions may be omitted.
True
In a nested loop, the inner loop goes through all of its iterations for every single iteration of the outer loop.
True
Jin a nested loop, the break statement only interrupts the loop it is placed in.
True
The while loop is a pretest loop.
True
Variables may be defined inside the body of a loop.
True
When you call an ofstream object´s open member function, the specified file wil be erased if it already exists.
True
The ... and ... loops will not iterate at all if the test expression is false to start with.
While, for