Iteration Flashcards
1
Q
What is ‘iteration’?
A
Repeating the same process until stopped.
2
Q
How is ‘iteration’ used?
A
To create loop statements.
Ex:
1| arrived = False
2| WHILE arrived == False
3| PRINT(“Are we nearly there yet?”)
4| ENDWHILE
3
Q
What are ‘condition-controlled’ iterations?
(aka ‘indefinite iteration’)
A
When a set of instructions are repeated based on whether a condition evaluates as True or False.
Ex: ‘while’ loops, ‘do while’ loops. and ‘repeat until’ loops
4
Q
What are ‘count-controlled’ iterations?
(aka ‘definite iteration’)
A
When a set of instructions are repeated a specific number of times.
Ex: ‘for’ loops, and ‘for each’ loops.