Loops Flashcards

1
Q

Loop

A

Repeatedly executes specific code

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

While Loop

A

Repeatedly executes specific code as long as some condition is true
Used when user interaction is evaluated

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

Loop Body

A

Sub-statements inside braces

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

Iteration

A

Each execution of the loop body

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

Infinite Loop

A

Loop that always executes because expression always evaluates to true

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

Loop Variable

A

Counts the number of loop iterations

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

For Loop

A

Executes for n number of iterations

Used when programmer knows how many iterations will occur

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

Nested Loop

A

Loop (inner loop) that appears in the body of another loop (outer loop)

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

Do-while Loop

A

First executes loop body’s statements then check loop condition

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

Break Statement

A

Causes immediate exit of a loop

Listed as a if statement

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

Continue Statement

A

Causes an immediate jump to the next loop iteration, even if there is still loop body that hasn’t been executed

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