test 5 Flashcards

1
Q

Overriding a user’s entered value by setting it to a predetermined value is known as _______________.

A

forcing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A variable might hold an incorrect value even when it is _______________.

A

a. a constant coded by the programmer
b. the correct data type
c. within a required range
d. all of the above1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Most programmers use a for loop _______________.

A

c. when they know the exact number of times a loop will repeat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A counter keeps track of _______________.

A

d. the number of times an event has occurred

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following is an indefinite loop?

A

a. a loop that follows a prompt that asks a user how many repetitions to make and uses the value to control the loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A do-while loop _______________.

A

d. can be replaced by a sequence and a while loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When two loops are nested, the loop that is contained by the other is the _______________ loop.

A

inner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When loops are nested, _______________.

A

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==

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Adding 1 to a variable is also called _______________ it.

A

incrementing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

After an accumulator or counter variable is displayed at the end of a program, it is best to _______________.

A

a. subtract 1 from the variable
b. delete the variable from the program
c. reset the variable to 0
d. none of the above===

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Typically, the value added to a counter variable is _______________.

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

To ensure that a user’s entry is the correct data type, frequently you _______________.

A

a. use a method built into the programming language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The statements executed within a loop are known collectively as the _______________.

A

d. loop body

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following is not a step that must occur with every correctly working loop?

A

d. Set the loop control value equal to a sentinel during each iteration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When you _______________, you make sure data items are the correct type and fall within the correct range.

A

d. validate data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The loop that frequently appears in a program’s mainline logic _______________.

A

b. works correctly based on the same logic as other loops

17
Q

A report that lists only totals, with no details about individual records, is a(n) _______________ report.

18
Q

Which of the following is a definite loop?

A

b. a loop that executes 1,000 times

19
Q

The structure that allows you to write one set of instructions that operates on multiple, separate sets of data is the _______________.

20
Q

Typically, the value added to an accumulator variable is _______________.

A

c. different in each iteration