Unplugged Lesson
Beginner
40 mins
Teacher/Student led
+50 XP
What you need:
IWB/Projector/Large Screen

Conditionals - The Lunch Robot

In this lesson, you'll explore how to make decisions in coding using conditional statements. Follow step-by-step activities to understand if/then/else logic, visualise concepts with flowcharts, and apply rules in a fun 'Lunch Robot' group activity.
Learning Goals Teacher Notes

Teacher Class Feed

Load previous activity

    1 - Introduction

    Hello! Welcome to the lesson on Conditionals with the Lunch Robot. This lesson is all about learning how to make decisions in coding, like saying 'if this happens, then do that'. We'll look at fun examples, draw flowcharts, and even pretend to be a robot that decides what to serve for lunch based on rules. Get ready for some exciting activities!

    2 - Conditional Statements

    Ask the students if they've ever had to make a decision based on something else happening."

    • Examples:

      • "If it's sunny, then I'll play outside."

      • "If the bus is late, then I'll walk to school."

      • "If I finish my homework, then I can watch TV."

    Explain that these are called "conditional statements." The word "conditional" means something depends on a condition being true.

    In coding, we use conditional statements to tell a computer what to do based on different situations. The most basic one is the "if... then..." statement.

    3 - Visualising the Statement

    Display the following Flowchart:


    Explain that the computer is a "robot" that can only follow very specific instructions.

    We have to give it instructions for every possible outcome.

    4 - If/Then/Else

    Point out that this flowchart in the previous step only gives us one set of instructions if the condition is true.

    What if we want the computer to do something different if the condition is not true?

    In coding, when we want to give our robot an instruction for what to do if the condition is false, we use the word else."

    Think of it like giving a plan B! The robot will always have an instruction, no matter what!

    Look at this new flowchart that incorporates an 'Else' feature.


    5 - The Lunch Robot Activity

    Explain to the students that we are going to a 'Lunch Ordering Robot.' This robot's job is to figure out what to serve for lunch, but it needs very specific rules to follow. The rules are based on what's available."

    Establish the Rules (The Conditions): On the whiteboard, display the following list of "Rules" for the robot:

      • Rule A: If the day is Monday, then serve a roast.
      • Rule B: If the temperature is above 20°C, then serve a salad.
      • Rule C: If the day is Friday, then serve pizza.
      • Rule D: If we have pasta, then serve spaghetti.
      • Rule E: If the day is NOT Monday and the temperature is NOT above 20°C, then serve soup.

      (You may want to write these on a whiteboard/display chart so they can remain in sight for the lesson.)

      Introduce the Scenario: Explain to the students that they will work in small groups and pretend to be a "Lunch Robot." Their job is to follow the rules on the board precisely to create the day's menu.

      Unlock the Full Learning Experience

      Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

      Copyright Notice
      This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
      🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more