CIST 5031 Chapter 5

24 July 2022
4.7 (114 reviews)
30 test answers

Unlock all answers in this set

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