In this lesson, you'll teach your students about Conditional Logicโthe IF/THEN rules that help us make decisions.
We'll use the structure of the "Old MacDonald Had a Farm" song to show how an item (the IF) can prompt 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.
Materials Needed:

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!
Check teacher notes for some fun extensions that you can do with your class.
Tell the students that the "Old MacDonald" song is secretly built on a very simple computer rule.
The rule has two parts:
Put your hands together and say the complete rule clearly: IF the Cow is said, THEN you must Moo!
This is one of the most important rules a computer knows. We are making the same type of decisions with this song, just like a robot.
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).
Give each student a sheet that has several images of transport (cars, trains, boats, trucks, bikes, etc.).
Instruct the students to choose four different transport pictures they want in their own personal song. They will cut these images out.
For each picture they chose, they must glue it onto their worksheet and then create the unique noise that transport will make in their custom code. Encourage them to be creative with the sounds!