Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can create a program that uses selection.

      Key learning points

      1. Designs can be used to guide program development
      2. Conditions should be tested so that the correct outcomes are run
      3. By testing a program, bugs can be identified and fixed

      Keywords

      • Condition - a statement that can be either True or False

      • Test - to run a program to check if it works the way that you planned

      Common misconception

      You only need to test your program when you have finished writing it.

      Test your program often, especially after you finish a section.

      Teacher tip

      Anticipate common coding errors, such as misplaced actions or missing parts of the �if� then� else�� structure, and model how to debug these during whole-class demonstrations.

      Equipment

      Pupils will need access to a device with block-based programming software. Examples in this lesson use Scratch https://oak.link/scratch

      Licence

      This content is © Oak National Academy Limited (2026), licensed on Open Government Licence version 3.0
      except where otherwise stated. See Oak's terms & conditions
      (Collection 2).

      Lesson video

      Loading...

      Prior knowledge starter quiz

      6 Questions

      Q1.
      What does the 'if' block do in Scratch?

      It repeats an action many times.
      It draws a picture.
      Correct answer: It checks if something is True or False.
      It makes a sound.

      Q2.
      What do we call a plan with choices and different results?

      Correct Answer: branching algorithm

      Q3.
      Match each definition to its keyword.

      Correct Answer:input,in a program, the text or numbers that a user types in

      in a program, the text or numbers that a user types in

      Correct Answer:selection,part of a program where, if a condition is met, then commands are run

      part of a program where, if a condition is met, then commands are run

      Correct Answer:branching algorithm,decision-making flow with a condition and two outcomes

      decision-making flow with a condition and two outcomes

      Correct Answer:outcome,the message shown after a choice

      the message shown after a choice

      Q4.
      Arrange these steps for using an 'if ... then ... else ...' block:

      1 - The program checks a condition.
      2 - The program does one action if True.
      3 - The program does a different action if False.
      4 - The program moves to the next step.

      Q5.
      What is information typed by the user called in a program?

      Correct Answer: input, inputs

      Q6.
      What can a branching algorithm help you do before coding?

      Correct answer: plan the choices and outcomes in your program
      make your sprite bigger
      change the project’s name
      play a song

      6 Questions

      Q1.
      What is a condition in a program?

      a background picture
      the name of a sprite
      the size of the stage
      Correct answer: a statement that can be True or False

      Q2.
      What does the “if… then… else…” structure help your program do?

      Repeat actions forever.
      Change the background.
      Correct answer: Make decisions based on conditions.
      Add sound effects.

      Q3.
      What do we call a mistake in a program?

      Correct Answer: Bug, bug

      Q4.
      What should you do if your program does not work as you expected?

      Ignore it.
      Correct answer: Test the program to find and fix bugs.
      Add more code without checking.
      Start a new project.

      Q5.
      When should you test your program?

      only when you finish everything
      Correct answer: after each section you write
      never
      only if someone asks

      Q6.
      Put these steps for creating and testing a program in the correct order.

      1 - Plan how the program will run.
      2 - Create the code for the first section.
      3 - Test after each section is completed.
      4 - Once a section is complete, create the next section.
      5 - Test the code at the end.

      To help you plan your 5 computing lesson on: Testing a quiz, download all teaching resources for free and adapt to suit your pupils' needs...