1/24
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
while loop
A control structure that repeats a block of code as long as a boolean condition remains true; in Java it is a pre-test loop.
pre-test loop
A loop that checks its condition before each repetition (including the first), so the body may run zero times if the condition starts false.
loop condition
The boolean expression in a loop that determines whether the loop continues or stops.
infinite loop
A loop that never terminates because its condition never becomes false (often due to missing/incorrect updates).
initialization (in loops)
Setting up variables before the loop starts so the loop has correct starting state.
update (in loops)
The change made each iteration (often to a loop control variable) that moves the program toward termination.
counter-controlled repetition
A loop pattern that repeats by manually updating a counter variable until a boundary is reached (can be done with while or for).
sentinel-controlled repetition
A loop pattern that continues until a special value (the sentinel) is encountered, commonly used when the number of inputs is unknown.
sentinel value
A special value used to signal “stop” in a loop (e.g., 0 to end input/summing).
input validation loop
A loop that repeats while input is invalid, continuing to prompt/update until the data becomes acceptable.
loop control variable
A variable whose value affects the loop condition and thus controls when the loop ends (e.g., i, x).
tracing (loops)
Step-by-step tracking of variable changes across iterations to predict final output or returned values.
order of statements (loop body)
The idea that statements inside a loop execute in the written sequence, which can change outcomes when variables are updated.
String length
The number of characters in a String, obtained with str.length(), used to set safe loop bounds.
substring(a, b)
A String method that returns characters from index a up to (but not including) index b.
single-character substring pattern
Using str.substring(i, i + 1) to get the one-character String at index i.
off-by-one error
A boundary mistake (often using < vs <=) that causes one extra or one fewer iteration, or index out-of-bounds.
out-of-bounds (String indexing)
An error caused by using an invalid index (e.g., i == str.length()) when accessing characters/substrings.
for loop
A loop structure that combines initialization, condition, and update in one header; ideal for counting and index traversal.
for-loop header
The part of a for loop written as (initialization; condition; update) that controls loop behavior.
for-loop execution order
Initialization runs once; then condition is checked; if true the body runs; then update runs; then condition is checked again.
for-to-while equivalence
The concept that any for loop can be rewritten as a while loop by separating initialization, condition, and update.
scope (loop variable)
Where a variable can be used; a variable declared in a for header (e.g., int i) is only accessible within the loop.
nested iteration
A structure where one loop is inside another; the inner loop completes all its iterations for each outer-loop iteration.
pairwise comparison pattern (i < j)
A nested-loop technique that starts the inner index at i + 1 to ensure i < j, avoid self-comparison, and prevent counting pairs twice.