Skip to content
Menu

Year 5 (ages 9–10, Grade 4 in the US) · Computing · Selection · Lesson 4

Building a quiz

Planning, building, testing and debugging a quiz program with selection, a score variable, input and output, decomposition and common bugs.

Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

Whiteboard video lesson: Building a quiz

14-minute video lesson

Teaching, worked examples and 20 practice questions solved step by step.

Watch free for a month

What your child will learn

  • Plan a program
  • Build a quiz with if/else
  • Test with right and wrong inputs
  • Find and fix bugs

The method

  1. Plan.
  2. Build.
  3. Test.
  4. Debug.

Key words: debug, algorithm, decomposition, input, output, variable.

Worked examples

Worked examples from the lesson, with every step.

Question 1

Trace the quiz: answer = 8. What is the score?

  1. Step 1: true

Answer: 1 (and it says ‘Correct!’)

Question 2

Trace the quiz: answer = 6. What is the score?

  1. Step 1: false

Answer: 0 (and it says ‘It's 8!’)

Question 3

What does ‘join You scored score’ do?

  1. Step 1: joins text

Answer: joins the words with the score number, e.g. ‘You scored 1’