Starter quiz
- True or false? A subroutine can only be called once in a program.
- True
- False ✓
- Which word describes the order in which commands are run during a program?
- sequence ✓
- algorithm
- code
-
- What colour is the variables block in Scratch?
- orange ✓
- blue
- purple
- green
-
- What types of data can a variable hold?
- images
- text ✓
- numbers ✓
-
- In a bat and ball game, which of these parts of the game would be stored using a variable?
- points scored ✓
- movement of the sprite
- lives lost ✓
- time left ✓
- appearance of the stage
-
- When is the value of a variable usually set?
- at the beginning of a program ✓
- throughout the running of a program
- at the end of a program
- when triggered by an event
-
Exit quiz
- How many values can a variable hold at any one time?
- none
- one ✓
- two
- three
-
- When a variable is changed, what happens to the value?
- It is replaced by a new value. ✓
- It is joined by the new value.
- It is added to the new value.
-
- What is the name of the built-in variable in Scratch that holds user input?
- 'answer' ✓
- Which block can be used to combine a variable and a message in Scratch?
- join ✓
- combine
- add
-
Worksheet
Loading worksheet ...
Presentation
Loading presentation ...
Video
Lesson Details
Key learning points
- A variable is used to store a value in a program.
- A variable can be updated with a new value which replaces the initial value it was assigned.
- The value of a variable can be tracked throughout a program.
Common misconception
The value a variable holds cannot be updated and a computer remembers the previous values of variables.
A variable can be updated during a program. Once the value of a variable is updated in a program, the previous value is overwritten.
Keywords
Variable - a named piece of data, stored in a memory location in a computer
Value - the data a variable holds at a particular time
Trace - to track the value a variable holds at any time during a program
+