Peanut Butter and Jelly
Programming


Abstract

This lesson allows students to grasp the concept that a computer will only do what you tell it to do. This can be applied to UNIX, Search Engines, or HTML programming.

Students will do so by trying to generate a set of instructions to create a peanut butter and jelly sandwich. A person is used to represent the computer, which will not do anything not listed in the directions.

Objectives

Upon completion of this activity, students will have a better understanding of the importance of being specific in programming.

Student Prerequisites

Teacher Preparation

The class will need:

Lesson Outline

The person representing the computer should leave the room while the students come up with a set of instructions and write them on the board. When the computer comes back (s)he should begin to execute the instructions, doing only what is listed on the board. This process should be repeated several times, having the students refine the instructions based on what didn't work. For instance, the Computer may not do anything the first time with the instruction "Get a piece of bread" or "Open the bag of bread" because the Computer doesn't know what bread is or where to find it. The students must then add something like: "The bread is the rightmost object on the table". Similarly, the Computer does not know how to perform functions like opening jars or getting peanut butter, or even how much peanut butter to get. The students should figure out how get the computer to work. The intelligence of the computer is to be determined by the instructor.

Alternate Outlines

This activity can be done in several different ways

Suggested Follow-Up

At this point, the students should have grasped that it is imperative the computer has adequate instructions to go by. It may be a good idea to have a discussion on this topic providing examples of programs burdened by bugs or instructions that are not specific enough.

Using the Internet to
Communicate with Email
Using the Internet to
Communicate with talk
Email Etiquette Sheet
ISE Home