Chapter 5

25 July 2022
4.7 (114 reviews)
30 test answers

Unlock all answers in this set

Unlock answers (26)
question
Any loop that can be written as a Do-While loop can also be written as a While loop. t/f
answer
True
question
How many times will the following loop iterate. For j=1 To 5 Step 2 Display j End For 3 4 Infinite No Iterations 5
answer
Three
question
What type of loop uses a Boolean expression to control the number of times that it repeats a statement or set of statements? While Do-Until Do-While Count-Controlled Condition-Controlled
answer
Condition-Controlled
question
The amount by which the counter variable is incremented in a For loop is known as what. Counter differential Step amount Incremental value additive index none
answer
Step amount
question
In a, For loop, the programmer should know the exact number of iterations the loop must perform before writing the code. t/f
answer
False
question
Which structure causes a statement or set of statements to execute repeatedly. Repetition Sequence Decision Start Over None
answer
Repetiton
question
A While loop repeats infinitely when there is no statement inside the loop body that makes the test condition false. t/f
answer
True
question
Which loop repeats a statement or set of statements as long as the Boolean expression is false? none Do-Until Do-While For While
answer
Do-Until
question
How many times will the following loop iterate? Set k=1 While k < = 5 Display k End While 1 2 3 4 Infinite none
answer
Infinite
question
In a count controlled loop, the counter performs ______ actions. 1 2 3 4 5
answer
3
question
The While loop is known as a pretest loop, which means it tests conditions before performing iteration. t/f
answer
True
question
How many times will the following loop iterate. Set k= 1 While k> 5 Display k End while 1 2 3 4 5 no iterations
answer
No Iterations
question
The statements that appear between the while and the End While clauses are called the Loop Body of the Loop Loop Statements Statements While Statements
answer
Body of the Loop
question
The following is an example of what type of loop? For k=7 To maxValue Do-While Do-Until Condition Controlled While Count Controlled
answer
Count Controlled
question
Which loop statement does not contain an increment statement but automatically increments the counter at the end of each iteration? For Do-Until Do-While While None
answer
For
question
The _______ represents a special value that marks the end of a list of values. Stop None of the Above Sentinel End All of the Above
answer
Sentinel
question
The While and For loops are considered pretest loops because they test the condition before processing the statements in the loop body. t/f
answer
True
question
Which pair of loops causes a statement or set of statements to repeat as long as a condition is true? While and Do- Until Do-While and For Do Until and For Do-While and Do-Until While and Do While
answer
While and Do While
question
How many times will the following loop iterate. Set k= 1 Do Display k Set k = k+1 Until k> 1 1 2 3 4 Infinite No Iterations
answer
1
question
A condition controlled loop can be used to iterate the body of the loop a specific number of times. t/f
answer
True
question
A loop that accumulates a total as it reads each number from a series is often said to keep a what? Running Total Maximum Value Average Accumulation
answer
Running total
question
A posttest loop does not perform any iteration if the Boolean expression is false to begin with. t/f
answer
False
question
Modules can be called from statements in the body of any loop. t/f
answer
True
question
The conditions that control a loop repetition are Boolean expressions. t/f
answer
True
question
In the For statement, you can only use positive integers as step values. t/f
answer
False
question
Which of these are post test loops. Do- While and Do-Until Do- While and For While and For While and Do-While Do- Until and For
answer
Do-While and Do-Until
question
The while loop gets its name from the way it works: While a condition is false, do some task. t/f
answer
False
question
Which loop is specifically designed to initialize, test, and increment a counter variable? While For Do-Until Do-While Nonw
answer
For
question
The while loop will never execute if its condition is true to start with. t/f
answer
False
question
To ________ a variable means to decrease its value. Increment Decrement Negate Inititialize Reference
answer
Decrement