logic ch5 Flashcards
A posttest loop does not perform any iteration if the Boolean expression is false to begin with.
F
In a For loop, the programmer should know the exact number of iterations the loop must perform before writing the code.
False
The _______ represents a special value that marks the end of a list of values.
sentinel
What type of loop uses a Boolean expression to control the number of times that it repeats a statement or set of statements?
condition controlled
the amount by which the counter variable is incremented in a For loop is known as what?
step amount
A structure that has a loop inside another loop is called a ______ loop.
nested
the ________ loop is the best choice when you want to perform a task until a condition is true.
Do-Until
the statements that appear between the While and the End While clauses are calle the
body of the loop
The While loop will never execute if its condition is true to start with.
F
Which structure causes a statement or set of statements to execute repeatedly?
repetition
In a For loop, a negative step value is used to ________ the counter variable.
decrement
Any loop that can be written as a Do-While loop can also be written as a While loop.
T
Which loop statement does not contain an increment statement but automatically increments the counter at the end of each iteration?
For
The term ________ is used in the For loop if the counter needs to be incremented by a value other than one.
step amount
The variable that is used to keep the running total in a loop is called a ______ in programming.
accumulator
Which loop repeats a statement or set of statements as long as the Boolean expression is false?
Do-Until
The _____ statement is specifically designed to initialize, test, and increment a counter variable.
For
The While loop gets its name from the way it works: While a condition is false, do some task.
F
In the For statement, you can only use positive integers as step values.
F
Which pair of loops causes a statement or set of statements to repeat as long as a condition is true?
While and Do-While
Which loop is specifically designed to intialize, test, and increment a counter variable?
For
In a count-controlled loop, the counter performs _______ actions.
3
A count controlled loop uses a variable known as _________ to store the number of iterations that has performed.
counter variable, or counter
An inner loop goes through all of its iterations for every single iteration of the _______ loop.
outer
A(n) ______ loop continues to repeat until the program is interrupted.
infinite?