# Programming Logic And Design: Chapter 5

## Unlock all answers in this set

question
Which structure causes a statement or set of statements to execute repeatedly? A ) Start Over B ) Sequence C ) Decision D ) Repetition E ) None of these
Repetition
question
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 B ) While and Do-Until C ) Do-While and Do-Until D ) Do-Until and For E ) Do-While and For
While and Do-While
question
Which loop repeats a statement or set of statements as long as the Boolean expression is false? A ) Do-While B ) Do-Until C ) For D ) While E ) None of these
Do-Until
question
The statements that appear between the While and the End While clauses are called the ________. A ) Statements B ) Loop C ) Body of the loop D ) Loop statements E ) While statements
Body of the loop
question
Which of these are posttest loops? A ) While and Do-While B ) While and Do-Until C ) Do-While and Do-Until D ) Do-Until and For E ) Do-While and For
Do-While and Do-Until
question
Which loop statement does not contain an increment statement but automatically increments the counter at the end of each iteration? A ) Do-While B ) Do-Until C ) For D ) While E ) None of these
For
question
The following is an example of what type of loop? For k = 7 To max Value A ) Count-controlled B ) Condition-controlled C ) While D ) Do-while E ) Do-until
Count-controlled
question
The ________ represents a special value that marks the end of a list of values. A ) Sentinel B ) Stop C ) End D ) Any of these E ) None of these
Sentinel
question
Which loop is specifically designed to initialize, test, and increment a counter variable? A ) Do-While B ) Do-Until C ) For D ) While E ) None of these
For
question
How many times will the following loop iterate? For j = 1 To 5 Step 2 Display j End For A ) Three B ) Four C ) Five D ) No iterations E ) Infinite
Three
question
How many times will the following loop iterate? Set k = 1 While k <= 5 Display k End While A ) Three B ) Two C ) Five D ) No iterations E ) Infinite Infinite
Infinite
question
How many times will the following loo interate? Set k = 1 While k > 5 Display k End While A ) One B ) Two C ) Five D ) No iterations E ) Infinite
No iterations
question
How many times will the following loop iterate? Set k = 1 Do Display k Set k = k + 1 Until k > 1 A ) One B ) Two C ) Three D ) No iterations E ) Infinite
One
question
To ________ a variable means to decrease its value. A ) Negate B ) Increment C ) Initialize D ) Decrement E ) Reference
Decrement
question
A loop that accumulates a total as it reads each number from a series is often said to keep a what? A ) Average B ) Maximum value C ) Running total D ) Accumulation E ) None of these
Running total
question
The conditions that control a loop repetition are Boolean expressions.
True
question
The While and For loops are considered pretest loops because they test the condition before processing the statement(s) in the loop body.
True
question
The While loop is known as a pretest loop, which means it tests its condition before performing an iteration.
True
question
In a For loop, the programmer should know the exact number of iterations the loop must perform before writing the code.
False
question
The While loop gets its name from the way it works: While a condition is false, do some task.
False
question
A condition-controlled loop can be used to iterate the body of the loop a specific number of times.
True
question
A While loop repeats infinitely when there is no statement inside the loop body that makes the test condition false.
True
question
A posttest loop does not perform any iteration if the Boolean expression is false to begin with.
False
question
Modules can be called from statements in the body of any loop.