Name Date
ON ONE CONDITION...
Instructions for Educators
This worksheet contains four exercises that students can complete individually or in groups.
The first three parts will be done on paper, and part 4 includes an online activity:
Part 1: Students fill in the blanks to create conditional statements from daily life.
Part 2: Students write conditional statements to reflect given scenarios.
Part 3: Given conditional statements and an input for the program, students run
through the conditional and determine what action the program would take.
Part 4: Students complete an interactive activity on Code.org called Bee Conditionals.
The activity uses code in the form of blocks. Students will drag blocks together
to control the bee’s actions. They’ll return to the worksheet to flesh out one of
the conditionals they created in the activity.
You can begin this sequence by reviewing vocabulary from the video and interactive
lyrics as a class:
Conditionals: statements that only run under certain conditions, or when certain criteria
are met
Condition: something that must be true in order for something to happen
Program: a series of steps to complete a task that a computer can understand
Control Flow: the order in which a program carries out instructions
Control Flow
Statements: code that directs the program to run in different ways depending on what
else is happening
Coding: the process of writing instructions for a computer in a language that it can
understand
Syntax: a set of rules for how a coding language is written
Pseudocode: language that’s more precise than English but less precise than a coding
language that a computer can understand
page • 1
Name Date
ON ONE CONDITION...
Student Worksheet
Part 1
We use the concept of conditionals in our daily lives! Complete each conditional statement
below with an action the person should take if the condition is true and an action the person
should take if it’s false. The first one is done as an example:
If Sierra has soccer practice later, she should pack her gym clothes.
Else, she should leave her gym clothes at home.
A
If Angel wakes up and notices that it’s raining, he should
Else,
B If Yuri has a test tomorrow, he should
Else,
page • 2
Name Date
Part 2
Read each scenario below, and write a conditional to represent how it works. Write it in
English or in any form of pseudocode or real code that you want.
A A restaurant has a machine to package food that customers order. It follows
these instructions:
• If the customer asked for ketchup, it puts five packets of ketchup in
the bag and seals it.
• If the customer didn’t ask for ketchup, it just seals the bag.
Conditional:
Bonus
Rewrite your conditional to include an else if condition using the following
information:
• If the customer asked for extra ketchup, it puts 10 packets of ketchup
in the bag and seals it.
Conditional:
page • 3
Name Date
B You’re writing a program that will cause your phone to do different things
depending who’s calling you. The program will check to see who is calling and
then decide what to do:
• If your friend Drea is calling, automatically answer the call.
• If anyone else besides Drea is calling, play your voicemail
message.
Conditional:
Bonus
Rewrite your conditional to include an else if condition using the following
information:
• If your friend Drea is not calling, but your mom is calling, automati-
cally send a text message that says, “Hi, mom.”
Conditional:
page • 4
Name Date
Part 3
Below, we’ve written two conditionals and provided the input that the
program would use. Go through each conditional with the input provided
and figure out what the outcome would be.
Here’s an example. This conditional determines what a robot will do depending on what its
level of happiness is:
Conditional
If robot happiness is high, the robot will breakdance. Input
Else if robot happiness is medium, the robot will
moonwalk. Robot happiness is medium.
Else, the robot will cry..
Outcome
Using the input provided, what
will the outcome of the The robot will moonwalk.
conditional be?
A You’re playing a game where you roll a die and win points depending on the number you roll.
Conditional
If you roll a 5 or a 6, your team gets 1 point. Input
Else if you roll a 3 or a 4, the other team gets 1 point. You roll a 2.
Else (you roll a 1 or a 2), neither team gets a point.
Outcome
Using the input provided,
what will the outcome of
the conditional be?
B A program sorts names into different columns depending on the letters it contains.
Conditional
If the name contains more consonants than vowels,
Input
put the name in column 1.
Else if the name contains more vowels than The name is Maria.
consonants, put the name in column 2.
Else, put the name in column 3.
Outcome
Using the input provided, what
will the outcome of the
conditional be?
page • 5
Name Date
Part 4
Practice using conditionals in an online activity on Code.org!
In this activity, you’ll control a bee’s actions and direct it to do things like get nectar
from flowers and make honey from the nectar. This game uses code in the form of
blocks. You’ll drag blocks together to make the bee take actions like “move forward”
and “turn right.” You’ll use blue blocks for conditional statements, and you can adjust
the condition and the action the program will take if the condition is true.
Go to http://tinyurl.com/pdqllm9 to play “Bee Conditionals.”
This activity uses another key concept that you’ll find across coding languages:
looping. Looping is the action of doing something over and over a certain number
of times. The game uses a pink block for a loop, and you can change the number
of times you want the action to be repeated.
After you finish playing, pick one of the if statements you created in the activity
and write it below. Come up with else if and else statements for this conditional
and add them below the if statement. Consider: what do you want the bee to do
if the if condition isn’t true? What if the else if condition isn’t true?
page • 6