Lesson 2
Using variables in programs
Introduction
Pupils apply their understanding of variables to record star-jumps and write an algorithm to represent this. They explore a program using variables and debug it so the BBC micro:bit can be used to record an activity.
Learning objectives
- To write algorithms that use variables
- To explain how variables are used in programs
- To debug programs containing variables
You will need
Downloadable resources:
- Lesson plan
- Lesson slides
- HEX files
- star jump counter
- variables debug
- variables debug support
- variables debug challenge
Other resources:
Whiteboards & dry-wipe marker pens, printouts of slides, MakeCode editor, micro:bits (optional)
Quick links
Lesson plan
Introduction activity 1: Ready, steady, star-jump! (15 minutes)
Activity 2: Reviewing variables (15 minutes)
Activity 3: Using variables in programs (10 minutes)
Activity 4: Debugging (20 minutes)
Extension ideas
Differentiation
Opportunities for assessment
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.