Unplugged: Making a Sandwich

In this activity, you will learn about functions by writing code that makes a peanut butter and jelly sandwich.

Sandwich

Let your teacher (or a partner) be a “robot.” Pair up with another student and write pseudocode (written language instructions) for making a peanut butter and jelly sandwich. The idea is that when the instructions are given to your “robot”, they will be able to follow them exactly and make a peanut butter and jelly sandwich.

Give your pseudocode to the “robot” and watch as they act out the instructions.

Did it work? Was the “robot” able to successfully make a peanut butter and jelly sandwich? If not, try to rewrite your pseudocode. This time make sure to ask what functions the “robot” already knows how to do. This way, you don’t have to write instructions for something the “robot” already knows how to do.

Give your revised pseudocode functions back to the “robot” and have them act it out.

Keep revising until the “robot” is able to successfully make a peanut butter and jelly sandwich.

Teacher Material