Skip to the page
Year 7 · Spring 2 · Scratch I: Programming essentials

Iteration: count-controlled and condition-controlled loops

PracticalPresent ▶

What this lesson covers

Topic 11 Algorithms

KS3 Computing · An algorithm is a precise, step-by-step plan to solve a problem. Computational thinking turns a messy problem into one. Every algorithm is built from just three things: sequence, selection and iteration.

ProgrammingCambridge Lower Secondary Computing 0860

You will learn to

  • Explain the difference between a count-controlled loop and a condition-controlled loop.
  • Use repeat to draw a shape with fewer blocks.
  • Use repeat until to keep going until something happens.
  • Trace a loop and count how many times it runs.

Success criteria

  • I can draw a square with repeat 4 instead of eight separate blocks.
  • I can make a sprite keep moving until it touches something.
  • I can say how many times a loop will run before I run it.

Key words

Say each word, then read what it means. Every one is in the glossary too.

trace table
Records variable values step by step to check logic.
Algorithm
Precise, ordered, finite steps to solve a problem.
Decomposition
Breaking a problem into smaller ones.
Abstraction
Ignoring detail that doesn't matter for the problem.
Sequence · selection · iteration
Steps one after another. First this, then this.
Pseudocode
Code-like writing for algorithms, without strict rules.
Variable
A named place in memory that holds a value.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Trace tables

A trace table records every variable at each step, to check the algorithm works.

Passnn > biggest?biggest after
17No7
23No7
312Yes12
45No12
e.g.Example

Output: 12. Correct.

Study it

Open the study page and go one step at a time.

The steps for this lesson

Try it

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.