Chapter 5

¡Supera tus tareas y exámenes ahora con Quizwiz!

How many times would the following loop iterate? Set k = 1 While k > 5 Display k End While ------------------- 0 4 5 infinite

0

How many times would the following loop iterate? For m = 1 To 8 step 3 Display m End For ------------------------ 3 4 5 infinite

3

How many times would the following loop iterate? Set k = 1 While k < 5 Display k Set k = k + 1 End While ------------------- 3 4 5 infinite

3

Which of the following is the structure that causes a statement or set of statements to execute repeatedly? sequence selection decision repetition

Repetition

A loop that accumulates a total as it reads each number from a series is often said to keep a(n) ________ average running total accumulation maximum value

Running total

The amount by which the counter variable is incremented or decremented in a For loop is known as the ________. incremental value step amount accumulator counter index

Step amount

Modules can be called from statements in the body of any loop True or False

True

While and For loops are considered pretest loops because they test the condition before processing the statement or statements in the loop body. True or False

True

If an expression is False, the ________ operator will return True. AND OR NOT All are unary operators

NOT

A While loop repeats infinitely when there is no statement inside the loop body that will make the test condition false. True or False

True

A condition-controlled loop can be used to iterate the body of the loop a specific number of times. True or False

True

The Do-While loop is a posttest loop. True or False

True

How many times would the following loop iterate? Set k = 1 While k <= 5 Display k End While ------------------- 0 4 5 infinite

Infinite

Statements that appear between the While and End While statements are known as the ________. While statements iteration values loop body loop

Loop body

The following is an example of a(n) ________ loop. While x < 10 set sum = sum + x set x = x + 1 End While ------------------------------ count-controlled Do-While While condition-controlled

Condition-controlled

Which type of loop uses a Boolean expression to control the number of times a loop repeats? accumulator condition-controlled count-controlled For

Condition-controlled

The While loop gets its name from the way it works: It does a task while a condition is false. True or False

False

The test condition in a While loop must always be an integer value. True or False

False


Conjuntos de estudio relacionados

NUR255: MyLab ch. 35, Influenza Questions

View Set

science...atmosphere weather and climate

View Set

13.7 Why Do Technology Projects Fail?

View Set

Ch.16 America's Gilded Age, 1870- 1890

View Set

Engineering Graphics Drafting 1-9

View Set