Home
Flashcards
Preview
Chapter 4 Loops
Home
Get App
Take Quiz
Create
A _______ loop executes statements repeatedly while the condition is true.
while
The loop-continuation-condition must always appear within the __________.
parentheses
(count < 100) is an example of a ______ ______ ______.
loop continuation condition.
In order for the loop-continuation-condition to eventually terminate it will have to eventually become _______.
True
False
false
A _______ loop is the same as a while loop except it executes the loop body first and then checks the loop continuation condition.
do-while.
A ________ loop has a concise syntax for writing loops.
for
Three types of repetition statements (loops) are:
while
do-while
for
The part of the loop that contains the statements to be repeated is called the _____ ______
loop body
A one time execution of a loop body is referred to as an _______ of the loop.
iteration
An ______ loop is a loop that executes infinitely.
infinite
The while loop checks the ______ _____ ______ first. If the condition is true, the loop body is _________. If it is false, the loop ________.
loop-continuation-condition
executed
terminates
A _______ value is a special value that signifies the end of a loop.
sentinel
The ____ loop generally is used to execute a loop body a predictable number of times; this number is not determined by the loop body.
for
The while and for loop are called the _____ loops because the continuation condition is checked before the loop body is executed.
pretest
The do-while loop is called a _________ loop because the continuation condition is checked after the loop body is executed.
postest
Looping makes computer programming ______ and ________.
efficient
worthwhile
A loop is a structure that ______ ______ while some condition continues.
repeats actions.
A _______ loop executes a predetermined number of times.
definite
Loop control variables are altered by ________ and _______.
incrementing
decrementing
A _______ ______ loop is a program that counts loop repetitions.
counter - controlled
True or false. An indefinite loop and infinite loop are the same.
True
False
False.
A for loop automatically does these 3 things:
Initializes
Evaluates
Increments
An ________ is a variable that gathers values.
accumulator
These 3 steps must occur in every loop:
Initialize loop control variable
Compare variable to some value
Alter the variable that controls the loop
Loops within loops are called ______ loops.
nested
Nested loops maintain two individual ______ _______ ________.
loop control variables
Loops are used to ensure data is ______ by prompting the ______.
valid
user
A _______ loop is used with definite loops when number of _______ is known.
for
iterations
4 common mistakes made by programmers:
Neglecting to initialize loop control variable
Neglecting to alter loop control variable
Using wrong comparison with loop control variable
Including statements inside the loop that belong outside the loop.
Author
randycapped
ID
246917
Card Set
Chapter 4 Loops
Description
Hruby
Updated
2013-11-14T20:56:36Z
Show Answers
Home
Flashcards
Preview