Skip to main content
Codepiko
TR
All lesson plans

To save as PDF, choose “Save as PDF” as the destination in the print dialog.

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

  1. 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.”

  2. 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?

  3. 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
  4. 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

  1. If programs with and without a loop do the same job, why is the loop better?
  2. Which component makes the fish turn back at the edge?
  3. 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.

Codepiko · lesson plan · codepiko.com/en/teacher/plans/dongu-kosul