test 5 Flashcards
Overriding a user’s entered value by setting it to a predetermined value is known as _______________.
forcing
A variable might hold an incorrect value even when it is _______________.
a. a constant coded by the programmer
b. the correct data type
c. within a required range
d. all of the above1
Most programmers use a for loop _______________.
c. when they know the exact number of times a loop will repeat
A counter keeps track of _______________.
d. the number of times an event has occurred
Which of the following is an indefinite loop?
a. a loop that follows a prompt that asks a user how many repetitions to make and uses the value to control the loop
A do-while loop _______________.
d. can be replaced by a sequence and a while loop
When two loops are nested, the loop that is contained by the other is the _______________ loop.
inner
When loops are nested, _______________.
a. one must end before the other begins
b. both must be the same type-definite or indefinite
c. they typically share a loop control variable
d. none of the above==
Adding 1 to a variable is also called _______________ it.
incrementing
After an accumulator or counter variable is displayed at the end of a program, it is best to _______________.
a. subtract 1 from the variable
b. delete the variable from the program
c. reset the variable to 0
d. none of the above===
Typically, the value added to a counter variable is _______________.
1
To ensure that a user’s entry is the correct data type, frequently you _______________.
a. use a method built into the programming language
The statements executed within a loop are known collectively as the _______________.
d. loop body
Which of the following is not a step that must occur with every correctly working loop?
d. Set the loop control value equal to a sentinel during each iteration.
When you _______________, you make sure data items are the correct type and fall within the correct range.
d. validate data
The loop that frequently appears in a program’s mainline logic _______________.
b. works correctly based on the same logic as other loops
A report that lists only totals, with no details about individual records, is a(n) _______________ report.
summary
Which of the following is a definite loop?
b. a loop that executes 1,000 times
The structure that allows you to write one set of instructions that operates on multiple, separate sets of data is the _______________.
d. loop
Typically, the value added to an accumulator variable is _______________.
c. different in each iteration