Ch. 5.6: The for Loop Flashcards

1
Q

What is a conditional loop?

A

A loop that will execute as long as the input value is invalid.

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

What is a count-controlled loop?

A

A loop where you know the exact number of iterations that a loop must perform.

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

What is the for loop?

A

The for loop is specifically designed to initialize, test, and update a counter variable.

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

What is the initialization expression?

A

It is normally used to initialize a counter variable to its starting value.

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

What is the test expression?

A

This is an expression that controls the execution of the loop. As long as this expression is true the body of the for loop will repeat.

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

What is the update expression?

A

It executes at the end of each iteration. Typically, this is a statement that increments the loop’s counter variable.

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