3.1.4

Algorithms (2/2)

Test yourself

Algorithms

 

Illustrative background for RepetitionIllustrative background for Repetition ?? "content

Repetition

  • Repetition means doing the same step over again.
  • The step can be repeated with different variables.
    • A variable is something that can change.
Illustrative background for Repetition: exampleIllustrative background for Repetition: example ?? "content

Repetition: example

  • The toppings must be placed on the cakes.
  • The step is repeated for each cake (repetition).
  • But the type of topping can change each time (variable).
Illustrative background for Repeat until...Illustrative background for Repeat until... ?? "content

Repeat until...

  • Sometimes a step can be repeated until something happens.
  • Then we can move to the next step.
  • A step is repeated until something happens.
  • This step is called a ‘repeat until’ instruction.
Illustrative background for Repeat until: exampleIllustrative background for Repeat until: example ?? "content

Repeat until: example

  • Put cake batter in each paper case.
  • Repeat until all the cases are filled
  • Then stop and go to the next step.

Jump to other topics

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium