# CIST 5031 Chapter 5

## Unlock all answers in this set

question
True
T/F β A While loop repeats infinitely when there is no statement inside the loop body that makes the test condition false.
question
True
T/F β A condition-controlled loop can be used to iterate the body of the loop a specific number of times.
question
Running total
A loop that accumulates a total as it reads each number from a series is often said to keep a what?
question
False
T/F β A posttest loop does not perform any iteration if the Boolean expression is false to begin with.
question
True
T/F β Any loop that can be written as a Do-While loop can also be written as a While loop.
question
Three
How many times will the following loop iterate? For j = 1 To 5 Step 2 Display j End For
question
Infinite
How many times will the following loop iterate? Set k = 1 While k < = 5 Display k End While
question
No iterations
How many times will the following loop iterate? Set k = 1 While k > 5 Display k End While
question
One
How many times will the following loop iterate? Set k = 1 Do Display k Set k = k + 1 Until k > 1
question
False
T/F β In a For loop, the programmer should know the exact number of iterations the loop must perform before writing the code.
question
Three
In a count-controlled loop, the counter performs ________ action(s).
question
False
T/F β In the For statement, you can only use positive integers as step values.
question
True
T/F β Modules can be called from statements in the body of any loop.
question
True
T/F β The While and For loops are considered pretest loops because they test the condition before processing the statement(s) in the loop body.
question
False
T/F β The While loop gets its name from the way it works: While a condition is false, do some task.
question
True
T/F β The While loop is known as a pretest loop, which means it tests its condition before performing an iteration.
question
False
T/F β The While loop will never execute if its condition is true to start with.
question
Sentinel
The ________ represents a special value that marks the end of a list of values.
question
Step amount
The amount by which the counter variable is incremented in a For loop is known as what?
question
True
T/F β The conditions that control a loop repetition are Boolean expressions.
question
count-controlled
The following is an example of what type of loop? For k = 7 To maxValue
question
Body of the loop
The statements that appear between the While and the End While clauses are called the ________.
question
decrement
To ________ a variable means to decrease its value.
question
Condition-controlled
What type of loop uses a Boolean expression to control the number of times that it repeats a statement or set of statements?
question
For
Which loop is specifically designed to initialize, test, and increment a counter variable?
question
Do-Until
Which loop repeats a statement or set of statements as long as the Boolean expression is false?
question
For