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

If/Then (Old MacDonald had a Farm)

In this lesson, you'll explore how sounds can vary in length through engaging activities. Start by singing familiar songs, then learn to follow simple rules to create your own sound and movement codes with classmates.
Learning Goals Learning Outcomes Teacher Notes

Teacher Class Feed

Load previous activity

    1 - Introduction

    In this lesson, you'll teach your students about Conditional Logicβ€”the powerful IF/THEN rules that make computers smart.

    We'll use the familiar structure of the "Old MacDonald Had a Farm" song to show that an item (the IF) always forces a specific action (the THEN).

    By the end, the class will collaborate to write their own custom rules using school items, translating simple observations into a fun, logical program they can perform together.


    2 - Old MacDonald Had a Farm

    Explain to the class that today, the robot learns to make decisions based on rules.

    Begin the lesson by singing "Old MacDonald Had a Farm". Ask the students questions about the song such as "Do you know this song?, What kind of animals normally appear in this song? What sounds do they make?"

    You can go through this song 2 or 3 times if any children are unfamiliar!

    3 - Establish the Rule

    Tell the students that the "Old MacDonald" song is secretly built on a very simple computer rule that they must follow exactly.

    The rule has two parts:

    1. First, sing the verse of the song until you name the animal, like a Cow. Explain to the class that the animal is the magic word, the trigger that starts the action. In code, we call the trigger the IF part. So, the rule starts: "IF I say 'Cow'."
    2. Second, when the class makes the animal sound, point out that the Cow has now forced them to make the Moo sound. This action that must happen is the THEN part of the code.

    Put your hands together and say the complete rule clearly: IF the Cow is said, THEN you must Moo!

    This is the most basic rule a computer knows. We are making their brains follow the rule perfectly, just like a robot.

    4 - Translate IF/THEN to Your Class Code

    Now, tell the students you are going to write a brand new, secret code based on the new song: "Mrs. Mooney Had a Class" (or your teacher name/principal's name etc.). This time, the items in the classroom will be the Conditions that tell them to perform a movement and a sound instead of an animal noise.

    Ask the students to help you fill out the code table. For each object, we will choose a body percussion action and a word that makes sense for that object.

    For example:

    IF (The Condition)THEN (The Action)
    CrayonMake a colouring motion with your arm + say "Colour!"
    LunchboxMake an eating motion (hand to mouth) + say "Yum!"
    Library BookMake a small thumb-flicking motion (like turning a page) + whisper "Flick!"
    ScissorsMake your hands open and close quickly (a cutting motion) + say "Snip!"

    5 - Old MacDonald had a Train

    Tell the students that you are now writing a new song for Old MacDonaldβ€”he is trading his farm animals for modes of transport!

    Remind them that the rule is the same: the transport is the IF, and the sound is the THEN.

    Use the flip chart below to present the new Conditions (images of transport, one at a time).

    As you flip to each image (Train, Car, Boat, Airplane, etc.), ask the students: "If Old MacDonald had a Train, what noise would it make?"

    Agree on a new noise for each mode of transport in the flipchart (for example, bus = beep beep, train = choo choo, etc.).

    Lead the class in a quick test. You call out the transport (the IF), and the whole class executes the new, agreed-upon noise and possible movement (the THEN).

    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 DigitalSkills.org 2017 - 2025. 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