What is ‘iteration’?
Repeating the same process until stopped.
How is ‘iteration’ used?
To create loop statements.
Ex:
1| arrived = False
2| WHILE arrived == False
3| PRINT(“Are we nearly there yet?”)
4| ENDWHILE
What are ‘condition-controlled’ iterations?
(aka ‘indefinite iteration’)
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
What are ‘count-controlled’ iterations?
(aka ‘definite iteration’)
When a set of instructions are repeated a specific number of times.
Ex: ‘for’ loops, and ‘for each’ loops.