Lesson 4: Repetition Control Structure Flashcards

1
Q

are used to execute a block of code
repeatedly based on a given condition or set of conditions

A

Looping statements in Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

These
statements are fundamental to Java programming, allowing for
iteration over data structures, repetitive tasks, and more

A

Looping statements in Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

4 types of looping statements in Java

A
  1. For loop
  2. While loop
  3. Do-while loop
  4. Nested loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

is a control structure that allows repeated execution of
a block of code for a specific number of times

A

for loop in Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

It is typically used when the
number of iterations is known beforehand

A

for loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

is executed (one time) before the
execution of the code block

A

Initialization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

defines the condition for executing the code block

A

Condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

is executed (every time) after the code block has been executed

A

Update

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

repeatedly executes a block of code as
long as a specified condition remains true

A

while loop in Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

It is ideal for
situations where the number of iterations is not
predetermined

A

while loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The loop continues to run as long as this condition evaluates
to true

A

Condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The statements inside the loop execute repeatedly until the condition becomes false

A

Code block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

is a post-tested loop, meaning it executes the
body of the loop at least once before checking the condition

A

do-while loop in Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

This loop is
useful when you need to ensure that the loop body is executed at least
once, regardless of whether the condition is true or false

A

do-while loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Do-while loop process repeats until the condition
becomes ____

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

This keyword starts the do-while loop

A

do

17
Q

These are the actions you want to perform. This block of code is executed on each iteration of the loop, and it is guaranteed to run at least once

A

Statements to execute

18
Q

This keyword is followed by a condition in parentheses

A

while

19
Q

A Boolean expression that is evaluated after the loop body has executed. If this condition
evaluates to true, the loop will execute again. If it evaluates to false, the loop will terminate, and control
passes to the statement immediately following the loop.

A

Condition

20
Q

It is also possible to place a loop inside another loop. This is called a ________

A

nested loop

21
Q

The “________” will be executed one time for each iteration of the
“________”:

A

inner loop; outer loop