1/35
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Loop
A structure that allows repeated execution of a block of statements.
Loop body
The block of statements that executes when the Boolean expression that controls the loop is true.
Iteration
One loop execution.
While loop
Executes a body of statements continually as long as the Boolean expression that controls entry into the loop continues to be true.
Definite loop
A loop that executes a specific number of times is a definite loop or a counted loop.
Indefinite loop
A loop in which the final number of loops is unknown.
Loop control variable
A variable whose value determines whether loop execution continues.
Infinite loop
A loop that never ends.
Empty body
A block with no statements in it.
Counter-controlled loop
A definite loop.
Incrementing
Incrementing a variable adds 1 to its value.
Decrementing
Decrementing a variable reduces its value by 1.
Event-controlled loop
An indefinite loop is an event-controlled loop.
Validating data
The process of ensuring that a value falls within a specified range.
Priming read or priming input
The first input statement prior to a loop that will execute subsequent input statements for the same variable.
Counting
The process of continually incrementing a variable to keep track of the number of occurrences of some event.
Accumulating
The process of repeatedly increasing a value by some amount to produce a total.
add and assign operator ( += )
Alters the value of the operand on the left by adding the operand on the right to it.
subtract and assign operator ( -= )
Alters the value of the operand on the left by subtracting the operand on the right from it.
multiply and assign operator ( *= )
Alters the value of the operand on the left by multiplying the operand on the right by it.
divide and assign operator ( /= )
Alters the value of the operand on the left by dividing the operand on the right into it.
remainder and assign operator ( %= )
Alters the value of the operand on the left by assigning the remainder when the left operand is divided by the right operand.
prefix ++ (prefix increment operator)
Adds 1 to a variable, then evaluates it.
postfix ++ (postfix increment operator)
Evaluates a variable, then adds 1 to it.
prefix and postfix decrement operators
subtract 1 from a variable.
for loop
A special loop that can be used when a definite number of loop iterations is required.
pretest loop
One in which the loop control variable is tested before the loop body executes.
do..while loop
Executes a loop body at least one time; it checks the loop control variable at the bottom of the loop after one repetition has occurred.
posttest loop
One in which the loop control variable is tested after the loop body executes.
inner loop
Contained entirely within another loop.
outer loop
Contains another loop.
do-nothing loop
One that performs no actions other than looping.
Loop fusion
The technique of combining two loops into one.
Counted Loop
A definite loop
Nested Loops
When one loop is contained within another.
Sentinel
A value that stops a loop