Lesson 2: Iterative Structures

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/44

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:11 PM on 7/22/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

45 Terms

1
New cards

Iterative Structures

Structures that cover While Loop, Do-while Loop, For Loop, Nested Loop, Break, and Continue.

2
New cards

While Loop

Repeats a block of statements while a given condition evaluates to true.

3
New cards

While Loop

Evaluates the condition before executing the loop body.

4
New cards

While Loop Syntax

while (expression) {
// statements
}

5
New cards

Expression in While Loop

A loop condition enclosed in parentheses in the While Loop

6
New cards

Expression in While Loop

Can be a relational or a logical expression that returns either a true or false value.

7
New cards

Loop Body

The statements enclosed in curly braces in the While Loop.

8
New cards

Loop Body

Can be either a simple statement or a compound statement.

9
New cards

Do–While Loop

Similar to a while loop but executes the loop body first before evaluating the expression.

10
New cards

Do–While Loop

The body is executed at least one before the expression is even evaluated.

11
New cards

Do–While Loop Syntax

do {
// statements
}
while (expression);

12
New cards

Do–While Loop

The expression appears at the end of the loop.

13
New cards

Do–While Loop

The statements in the loop are executed once before the expression is evaluated.

14
New cards

Do–While Loop

If the expression evaluates to true, control jumps back to the do statement.

15
New cards

Do–While Loop

The loop body executes repeatedly until the expression evaluates to false.

16
New cards

For Loop

Executes a sequence of statements multiple times.

17
New cards

For Loop

Abbreviates the code that manages the loop variable.

18
New cards

For Loop

Used when a definite number of loop iterations is required.

19
New cards

For Loop Syntax

for (initialization; condition; update) {
// statements
}

20
New cards

Initialization in For Loop

Indicates the starting value for the loop control variable.

21
New cards

Condition in For Loop

The loop condition that controls loop entry.

22
New cards

Update in For Loop

The expression that alters the loop control variable.

23
New cards

For Loop Parameters

Enclosed within parentheses in the For Loop.

24
New cards

For Loop Parameters

Separated by two (2) semicolons (;) in the For Loop

25
New cards

For Loop Parameters

What do you call the statements within the parentheses of the For Loop?
for(initialization; condition; update) {

26
New cards

Initialization

This executes first and only once in the first step of the For Loop

27
New cards

Condition

This is evaluated in the second step of the For Loop

28
New cards

Terminates

In the Step 2 of the For loop: If the loop condition evaluates to false, the loop _______.

29
New cards

Executes

In the Step 2 of the For loop: If the loop condition evaluates to true, the loop _______.

30
New cards

Nested Control Structures

Control statements that are placed within another control statement.

31
New cards

Nested Control Structures

Control structures in Java can be nested in many levels.

32
New cards

Nested Control Structures

Start and end braces must be placed correctly within the control structure.

33
New cards

Nested Loop

A loop placed inside another loop.

34
New cards

Nested Loop

It is used to print patterns or multiplication tables.

35
New cards

Outer Loop

It runs once and only iterates once the inner loop has broke or gotten past its condition.

36
New cards

Inner Loop

It runs all over again until a false value then breaks out of the loop, then goes out to the outer loop again and reiterates the outer loop.

37
New cards

Break

A control statement discussed under iterative structures.

38
New cards

Break

It is always used together with an If conditional statement

39
New cards

Break

It immediately terminates the innermost loop.

40
New cards

Break

It transfers execution to the next statement outside that block.

41
New cards

Break

It is commonly used in if statements within loops to exit prematurely based on a condition.

42
New cards

break;

It is the syntax of the break control statement.

43
New cards

Continue

It immediately ends the current iteration of a for, while, or do-while loop, skipping any remaining code, and jumps to the next iteration (or re-evaluates the loop condition)

44
New cards

Continue

It is commonly used within if statements to bypass specific, unwanted iterations without terminating the entire loop.

45
New cards

continue;

It is the syntax for the continue statement.