Frosted Cookie

Overview

Students write instructions for making a frosted cookie. The teacher follows their instructions exactly with ridiculous results. Students learn that computers only do exactly what you tell them to, and then English is imprecise.

Before Class

Materials: gloves, cookies (4 packs from Dollar Store), frosting (4), knife in a ziplock bag, napkins, paper, pencils (9), large trash bag

Prep: Get approval to use food in class area. Lay out trash bag as a tablecloth and put your cookie supplies on it.

Class Time

Intro: Computers will only do exactly what you tell them to. They aren’t smart enough to realize there is a problem. You have to be the smart one and give them good instructions! Imagine you were telling a person how to make a frosted cookie. You might say “put the frosting on the cookie” and they’d know what you meant. But if you told a computer that, you might get something like…(pick up the jar of frosting and put it on the package of cookies. Optionally, say “putting frosting on cookies” in a robotic voice). Is that what you want? So, we’re going to practice giving step-by-step instructions.

Pass out pencils and paper and give students a few minutes to write instructions. Put on gloves before touching the food. Have a student read their instructions and follow their instructions exactly.

For example:
  • “Pick up the knife” -> pick the knife up without removing it from the ziplock bag
  • “Stick the knife in the frosting” -> attempt to jam the knife through the lid of the frosting if they didn’t remove the lid first
  • “Scoop out some frosting” -> assuming the lid is off, scoop it out with your hand

Give students time to revise their instructions, then repeat.

After a few minutes, tell the students that we’ve seen a few things: that we have to think about step-by-step instructions when we’re programming computers, that we’re going to be trying things and making mistakes and trying some more, and that the English language can be very unclear--so we’re going to be “talking” to computers in a language called Java!

Pass out frosted cookies.