Codepiko · Grade 5 · BTY.5.6.3 (a) · 40 min
What stays and what changes: let’s build a score counter
Use the building blocks of software development
In the guide: Components Used in Software (lesson 1), p. 212
Goal
Students define command, constant and variable, and use a score on the stage whose value changes while the program runs.
Before the lesson
- Open the stage on the board; the first project comes with the robot character.
- Draw two columns on the board: “Constant” and “Variable”.
Lesson flow
Attention5 min
Constant or variable?
Collect examples from the class: the number of days in a week, today’s weather, the number of students in the class, the score in a match. Write each in one of the columns.
Lesson process10 min
Command and constant
On the stage, put the “Move steps” and “Say” blocks under “When started” and run it. Show that the block is a command and that the number inside it never changes while the program runs: it is a constant.
- Stage codepiko.com/en/stage
Lesson process17 min
Score counter
Students build this on their own stage: when started, set the score to 0; when the robot is clicked, change the score by 1; if the score is greater than 4, say “You win!”. The score changes while the program runs: it is a variable. Fast finishers can move on to the variable exercises in the Python section.
- Stage codepiko.com/en/stage
- Python · Variables codepiko.com/en/python
Assessment8 min
Fill in the columns
Students write every number in their project in one of the columns on the board. Why is the number of steps a constant and the score a variable?
Exit questions
- Which value in your program changes while it runs?
- What would happen if we didn’t set the score to 0 at the start?
- Give one constant and one variable from everyday life.
Without computers
In the Boxes and recipes activity, students follow a variable’s value by writing it in a box at each step.
- Unplugged activity · Boxes and recipes codepiko.com/en/unplugged/4
Codepiko · lesson plan · codepiko.com/en/teacher/plans/sabit-degisken