CH_4_Repitition_Structures Flashcards
Two broad categories of loops
Condition Controlled
Count Controlled
Repetition Structure (Loop)
Causes a statement or set of statements to execute repeatedly
Condition Controlled Loop
Causes a statement or set of statements to repeat as long as a condition is true.
Count Controlled Loop
A loop that repeats a specific number of times.
Iteration
A single execution of the body of a loop.
Pretest Loop
A loop that tests its condition before performing an iteration.
Counter Variable
A variable that is assigned a unique value during each iterations of a loop.
Three required actions of Count-Controlled While Loop
- Initialization
- Comparison
- Update
Infinite Loop
A loop that has no way of stopping.
Target Variable
The variable that is the target of an assignment during each iteration of a for loop.
Iterable
An object that contains a sequence of values and can be iterated over with a loop.
Step Value
In a for loop, the amount by which the counter variable is incremented.
Accumulator
The variable that accumulates the total of a group of values as a loop iterates.
Running Total
The ever-increasing total that is kept in an accumulator variable.
Augmented Assignment Operator
An assignment operator that is combined with a math operator.
Sentinel
A special value that marks the end of a sequence of values.
Input Validation (Error Trap or Error Handler)
The process of confirming the validity of input.
Priming Read
An input operation that occurs just before the first iteration of the loop that continues to read the input.