Code with Chompers
  • ⚙️ Settings
    • Increase Text Size
    • Decrease Text Size
    • Toggle High Contrast Mode
    • Toggle Dark Mode
    • Reset Settings
  • About
  • Outreach Guide
  • All K-6 Activities
  • Themed Modules

On this page

  • Description
  • Time Required
  • Materials Required
  • Picture of the Map
  • Steps to Conduct the Activity
    • Set-Up
    • Dificulty Breakdown
  • Discussion & Reflection
  • Wrap-Up
  • Learning Outcomes

Activity 1: Navigating Decisions with If-Else-Elif Statements

Teaching students the fundamentals of if-else-elif statements through hands-on activities.

Grade: 5
Time: 30 Minutes

Description

In this activity, students will learn the fundamentals of if-else-if else (elif) statements through a hands-on lesson involving a model car and a programmable robot. Students will explore decision-making using block code processes by programming the robot to navigate a multi-way road with a barricade, simulating real-life scenarios where alternate routes must be taken when the primary route is blocked.

Time Required

  • Estimated Time: 30-45 minutes

Materials Required

  • Model car
  • Two-/three-way road setup. Picture of demo map is shown below.
  • Barricade (mini yellow cones)
  • Programmable & Drivable Robot
  • Laptop or IPAD configured for the robot

Picture of the Map

Map Picture

Steps to Conduct the Activity

Set-Up

  • Split students into groups of two. Have them spread out throughout the room, ensuring each group has room to run the activity.
  • Each group should recieve one model car, one programmable robot, one road setup, some barricades, and one laptop or IPAD.
  • Have the students set up the barricades at different spots in the road setup.
  • Depending on previous experience, students can work with pre-made or self-designed paths.

Dificulty Breakdown

Beginner

  • Use simple examples to illustrate the concept of if-else statements, such as deciding whether to bring an umbrella based on whether it is raining.
  • Model an example barricade situation using the model car and map.
  • Use a guided road setup for the robot to use.
  • Limit the number of barricades on the map to 1.
  • 🔍 Focus Skills: real-life simulation, block coding basics, problem-solving

Intermediate

  • Use simple examples to illustrate the concept of if-else statements, such as deciding whether to bring an umbrella based on whether it is raining.
  • Model an example barricade situation using the model car and map.
  • Use a guided road setup for the robot to use.
  • Start with one barricade. Once students have grasped the concept with one barricade, increase to two and ask the students what they would do in the new situation.
  • 🔍 Focus Skills: real-life simulation, problem-solving, conditional programming

Discussion & Reflection

After the activity has been completed, gather the class for a quick debrief. We can ask:

  • Did you code work the first time? If not, how did you fix it?
  • What strategy did you use for loops or conditionals?
  • What part did you enjoy the most?

Wrap-Up

Participating in this activity will enhance students’ computational thinking. Block coding with the robot helps students understand basic coding principles and improves their programming skills. Encouraging students to create and solve obstacles in block coding will significantly boost their coding proficiency.

Learning Outcomes

By the end of this activity, students should be able to:

  • Comprehend the basic structure and function of if-else-elif statements in programming.
  • Use conditional statements to create decision-making processes in block coding.
  • Simulate real-life problem-solving by programming a robot to navigate alternate routes when the primary path is blocked.
  • Enhance their computational thinking skills by breaking down a problem into smaller, manageable conditions and actions.
  • Test their block code in a practical setup and debug any issues that arise to ensure the robot navigates correctly.
Back to top

Footer Image