Codepiko · Grade 5 · BTY.5.6.3 (c) · 40 min
Loop or condition? Evaluate the components
Use the building blocks of software development
In the guide: Components Used in Software (lesson 3), p. 220
Goal
Students solve the same problem with and without a loop, state a condition as an “if … then …” rule and evaluate how each component improved the program.
Before the lesson
- Open the “Robot Climb” game and the “Aquarium” guided project on the stage.
- Write “If … then …” on the board.
Lesson flow
Attention5 min
Green light, red light
Students take a step when you say “green” and stop when you say “red”. Then write the game’s rule on the board: “If the light is green, then walk.”
Lesson process15 min
Put the repeat in a loop
In “Robot Climb”, students solve a level first with single commands, then by putting the repeated part in a loop. Compare the number of lines in the two programs: why did the star count change?
- Game · Robot Climb codepiko.com/en/games/robot
Lesson process12 min
Forever and if
Open the “Aquarium” project on the stage: the fish keeps swimming and turns back at the edge. Students state this rule as an “If … then …” sentence, then finish the project with the automatic check.
- Stage codepiko.com/en/stage
Assessment8 min
Which one helped?
Pairs look at each other’s solutions and write two sentences: “The loop shortened …” and “The condition decided …”. Read a few out to the class.
Exit questions
- If programs with and without a loop do the same job, why is the loop better?
- Which component makes the fish turn back at the edge?
- Name a moment in a game where an “if” is needed.
Without computers
In the Shortcut master activity, students shorten a working program with a loop and repeat until a condition is met.
- Unplugged activity · Shortcut master codepiko.com/en/unplugged/3
Codepiko · lesson plan · codepiko.com/en/teacher/plans/dongu-kosul