Iteration

Computer Science: KS3, topic 2.1.9

Iteration

Iteration allows a group of statements to be repeated multiple times. Iteration statements are often called loops. There are two types of iteration: definite iteration and indefinite iteration.

Indefinite iteration

Indefinite iteration

  • A block of code will repeat while a specified condition is true.
Definite iteration

Definite iteration

  • A block of code will repeat a known number of times.
Flow diagram

Flow diagram

  • A flow diagram for iteration uses the diamond shape.

Test yourself on Iteration

  • What are the two types of iteration?

  • What is definite iteration?

  • What shape does a flow diagram for iteration use?

Practise this topic for free