Loops Flashcards

1
Q

What is a definite loop?

A

You know the exact amount of times you will need to repeat the statements.

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

What are the three common loop structures?

A

FOR
While-do
Repeat Until

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

Which loop can never be an indefinite loop?

A

The FOR loop can never be an indefinite loop.

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

What is the structure of a loop?

A

Initialization
Loop Header
Loop Statements
Conclusion

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

How do you start and end a FOR loop?

A

You begin with: FOR
You end with: END FOR

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

What is the repeat until loop?

A

The repeat until loop tests a condition at the end of the loop.

Statements in a loop will always be executed at least once.

The repeat until loop is repeating until something becomes true.

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

What is the While-Do loop?

A

The While-Do executes a condition until it becomes false.

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

What is the value called that will trigger the loop to stop.

A

It is called a terminating or sentinel value.

While variable <> sentinel value Do.

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