Peanut Butter and Jelly Programming
- Computer
- Middle

- Activity Time
- Materials
- Concepts / Topics
- Resource Type
Students write step-by-step sandwich instructions, then read them to the teacher, who follows the directions exactly to reveal errors in the program.
Goal
To understand the importance of "meaning what you say," or "garbage in, garbage out," integrated with sequential thinking. "Garbage in, garbage out" means that if a programmer states inaccurate or incorrect steps (garbage), the computer will output garbage as well.
Objective
Students will write specific and sequential steps on how to make a peanut butter and jelly sandwich.
Procedure
- For homework, students will write a very detailed, step-by-step paragraph on how to make a peanut butter and jelly sandwich.
- The next day, students will input (read) their instructions to the computer (teacher). The teacher will then carry out the programs, being sure to do exactly what the students said. For example, if they say, "Take a piece of bread out of the bag," the teacher would only take a small "piece" out instead of a slice (which is what they actually meant).
Assessment
I use this as an introduction to writing computer programs. I do not use it as a grade, except if the student did not do the assignment. Students have a great time with this assignment because they can actually "see" their errors, or bugs, in their programs when their sandwiches are only 1 inch square!
Acknowledgment
Special acknowledgment to Mrs. Holly Morrison, who was the initiator of this great lesson!
Teachers.Net · https://teachers.net/lessons/2166.html