Loops Flashcards
What is a definite loop?
You know the exact amount of times you will need to repeat the statements.
What are the three common loop structures?
FOR
While-do
Repeat Until
Which loop can never be an indefinite loop?
The FOR loop can never be an indefinite loop.
What is the structure of a loop?
Initialization
Loop Header
Loop Statements
Conclusion
How do you start and end a FOR loop?
You begin with: FOR
You end with: END FOR
What is the repeat until loop?
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.
What is the While-Do loop?
The While-Do executes a condition until it becomes false.
What is the value called that will trigger the loop to stop.
It is called a terminating or sentinel value.
While variable <> sentinel value Do.