logic ch5 Flashcards

1
Q

A posttest loop does not perform any iteration if the Boolean expression is false to begin with.

A

F

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

In a For loop, the programmer should know the exact number of iterations the loop must perform before writing the code.

A

False

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

The _______ represents a special value that marks the end of a list of values.

A

sentinel

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

What type of loop uses a Boolean expression to control the number of times that it repeats a statement or set of statements?

A

condition controlled

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

the amount by which the counter variable is incremented in a For loop is known as what?

A

step amount

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

A structure that has a loop inside another loop is called a ______ loop.

A

nested

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

the ________ loop is the best choice when you want to perform a task until a condition is true.

A

Do-Until

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

the statements that appear between the While and the End While clauses are calle the

A

body of the loop

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

The While loop will never execute if its condition is true to start with.

A

F

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

Which structure causes a statement or set of statements to execute repeatedly?

A

repetition

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

In a For loop, a negative step value is used to ________ the counter variable.

A

decrement

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

Any loop that can be written as a Do-While loop can also be written as a While loop.

A

T

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

Which loop statement does not contain an increment statement but automatically increments the counter at the end of each iteration?

A

For

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

The term ________ is used in the For loop if the counter needs to be incremented by a value other than one.

A

step amount

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

The variable that is used to keep the running total in a loop is called a ______ in programming.

A

accumulator

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

Which loop repeats a statement or set of statements as long as the Boolean expression is false?

17
Q

The _____ statement is specifically designed to initialize, test, and increment a counter variable.

18
Q

The While loop gets its name from the way it works: While a condition is false, do some task.

19
Q

In the For statement, you can only use positive integers as step values.

20
Q

Which pair of loops causes a statement or set of statements to repeat as long as a condition is true?

A

While and Do-While

21
Q

Which loop is specifically designed to intialize, test, and increment a counter variable?

22
Q

In a count-controlled loop, the counter performs _______ actions.

23
Q

A count controlled loop uses a variable known as _________ to store the number of iterations that has performed.

A

counter variable, or counter

24
Q

An inner loop goes through all of its iterations for every single iteration of the _______ loop.

25
Q

A(n) ______ loop continues to repeat until the program is interrupted.