Chapter 4 Multiple choice questions Flashcards
A ______-controlled loop uses a true/false condition to control the number of times that it repeats.
a) Boolean
b) condition
c) decision
d) count
A condition-controlled loop uses a true/false condition. (while loop)
A ______-controlled loop repeats a specific number of times.
a) Boolean
b) condition
c) decision
d) count
A count-controlled loop uses a specific number. (for loop)
Each repetition of a loop is known as a(n) ______.
a) cycle
b) revolution
c) orbit
d) iteration
Each repetition of a loop is known as an iteration.
The while loop is a ______ type of loop.
a) pretest
b) no-test
c) prequalified
d) post-iterative
The while loop is a pretest type of loop.
A(n) ______ loop has no way of ending and repeats until the program is interrupted.
a) indeterminate
b) interminable
c) infinite
d) timeless
An infinite loop.
The -= operator is an example of a(n) ______ operator.
a) relational
b) augmented assignment
c) complex assignment
d) reverse assignment
-= is an augmented assignment operator.
A(n) ______ variable keeps a running total.
a) sentinel
b) sum
c) total
d) accumulator
An accumulator variable keeps a running total.
A(n) ______ is a special value that signals when there are no more items from a list of items to be processed. This value cannot be mistaken as an item from the list.
a) sentinel
b) flag
c) signal
d) accumulator
A sentinel is a special value that signals when there are no more items to be processed.
GIGO stands for ______.
a) great input, great output
b) garbage in, garbage out
c) GIGahertz Output
d) GIGabyte Operation
Garbage in, garbage out.
The integrity of a program’s output is only as good as the integrity of the program’s ______.
a) compiler
b) programming language
c) input
d) debugger
The integrity of a program’s output is only as good as the integrity of the program’s input.
The input operation that appears just before a validation loop is known as the ______.
a) prevalidation read
b) primordial read
c) initialization read
d) priming read
Priming read
Validation loops are known as ______.
a) error traps
b) doomsday loops
c) error avoidance loops
d) defensive loops
Validation loops are known as error traps.
True or False:
A condition-controlled loop always repeats a specific number of times.
False, a condition-controlled loop is controlled by conditions.
True or False:
The while loop is a preset loop.
True, a while loop is a preset.
True or False:
The following statement subtracts 1 from x: x = x -1
True, and it irks mathematicians to no end.