Learn Without Walls
← Module 4 Home Lesson 1 of 4 Next Lesson →

Lesson 1: If/Then Thinking

Estimated time: 15-20 minutes | Screen-Free Activity

What You Will Learn

By the end of this lesson, your child will be able to:

Decisions Are Everywhere

Every single day, you make decisions. Some are small: "Should I wear the red shirt or the blue shirt?" Some are bigger: "Should I bring an umbrella to school?" You might not even notice you are making decisions because your brain does it so fast.

But here is something cool: almost every decision follows a simple pattern. It goes like this:

If/Then Rule -- A rule that says: "IF something is true, THEN do something." It has two parts: a condition (the "if" part that you check) and an action (the "then" part that you do).

You already use if/then rules all the time, even if you do not say the words "if" and "then" out loud!

If/Then Rules in Daily Life

Here are some if/then rules you probably follow every day:

IF it is raining outside, THEN take an umbrella.
IF you are hungry, THEN eat a snack.
IF it is bedtime, THEN put on your pajamas.
IF the traffic light is red, THEN stop and wait.
IF you are cold, THEN put on a jacket.

Notice the pattern: first you check something (is it raining? am I hungry? is the light red?), and then you do something based on the answer. The "if" part is what you check. The "then" part is what you do.

Talk About It

Read each if/then rule above with your child. Then ask: "What are some if/then rules that you follow?" Help them think of rules from school, home, or playing outside. Every rule they come up with shows they understand the pattern!

What Happens When the "If" Is Not True?

Sometimes the "if" part is not true. If it is NOT raining, do you still take an umbrella? Probably not! When the condition is not true, you do something different -- or nothing at all.

This gives us an even more powerful rule: if/then/else.

If/Then/Else -- "IF something is true, THEN do this. ELSE (otherwise), do that instead." This lets you handle both possibilities.

IF it is raining, THEN take an umbrella. ELSE wear sunglasses.
IF you finished your homework, THEN you can play. ELSE keep working on it.
IF the store is open, THEN go inside. ELSE come back later.

Think of It Like a Fork in the Road

Imagine you are walking and you come to a fork where the path splits in two. You have to choose: go left or go right. An if/then/else rule is like that fork. You check the condition, and based on the answer, you take one path or the other.

Why Computers Need If/Then Rules

Computers use if/then rules all the time. In fact, without if/then rules, computers could only do the same thing every time -- they could never make choices!

Every app, game, and website you have ever used is full of if/then rules. Hundreds or even thousands of them! In Lesson 4, you will use if/then rules in Scratch to make your own programs respond to what the user does.

Activity: The "What Would You Do?" Game

Screen-Free Activity (10 minutes)

How to play: Take turns describing a situation. The other person has to make an if/then rule for it.

Example situations:

  1. "You wake up and look outside. The ground is covered in snow." (If it is snowy, then wear boots and a warm coat.)
  2. "You open your lunchbox and your sandwich is missing." (If my sandwich is gone, then ask a teacher for help.)
  3. "A friend invites you to play, but you have not finished your homework." (If homework is not done, then finish it first. Else, go play!)
  4. "You are at the park and you hear thunder." (If you hear thunder, then go inside.)
  5. "Your favorite show is on, but it is time for dinner." (If it is dinnertime, then eat dinner first.)

Make up your own! Take turns being the one who describes the situation and the one who makes the rule. Try to use the words "if" and "then" every time.

Bonus challenge: Can you add an "else" to your rules? That means you handle both possibilities!

Make Your Own If/Then Rule Book

Optional Extension Activity

Fold a piece of paper in half to make a little book. On each page, write one if/then rule and draw a picture to go with it. Here are some ideas to fill your book:

  • Rules for school (If the bell rings, then...)
  • Rules for being a good friend (If a friend is sad, then...)
  • Rules for a pet (If the dog is barking, then...)
  • Rules for a superhero (If a villain appears, then...)
  • Silly rules (If a dinosaur walks into the kitchen, then...)

The sillier the rules, the more fun this is! And silly or serious, every rule still follows the if/then pattern.

Check Your Understanding

1. What are the two parts of an if/then rule?

Answer: The two parts are: (1) the condition -- the "if" part that you check, and (2) the action -- the "then" part that you do when the condition is true.

2. What does "else" mean in an if/then/else rule?

Answer: "Else" means "otherwise" -- it is what you do when the "if" part is NOT true. For example: If it is raining, take an umbrella. Else (if it is not raining), wear sunglasses.

3. Can you make an if/then rule for this situation: "You find a lost dog in your yard"?

Example answer: If you find a lost dog, then tell a parent so they can help find the owner. There are many good answers! The important thing is using the if/then pattern.

Key Takeaways

Ready for More?

Next Lesson

In Lesson 2, you will learn about yes/no questions -- the building blocks of all decisions. Plus, you will play 20 Questions!

Start Lesson 2

Module Progress

You have completed Lesson 1! Three more lessons to go in Module 4.