Chapter 5 Flashcards
Break Statement
Break out of the current loop
continue statement
Break out of the current iteration
do-while loop
A loop construct that begins with the keyword do.
for loop
A loop construct that begins with the keyword for.
infinite loop
A loop that runs indefinitely due to a bug in the loop.
input redirection
Obtain the input from a file instead of from the console.
iteration
One time execution of the loop body.
loop
A structure that controls repeated executions of a block of statements
loop body
The part of the loop that contains the statements to be repeated.
nested loop
Consists of an outer loop and one or more inner loops. Each time the outer loop is repeated, the inner loops are reentered, and all required iterations are performed.
off-by-one error
Programmers often mistakenly reference the first element in an array with index 1, but it should be 0. This is called the off-by-one error.
output redirection
Write the output to a file instead of to the console.
posttest loop
The loop continuation condition is checked after the loop body is executed.
pretest loop
The loop continuation condition is checked before the loop body is executed.
sentinel value
Terminates and input
while loop
A loop construct that begins with the keyword while.