This is a lesson on the high level idea of programming concepts. It is not specific to a particular computer language, environment, or other such limitations. The goal is to teach the ideas behind programming, not to teach programming itself.
Basic algebraic concepts (pre-algebra level) are helpful. Students need to be fluent in reading and writing of the language the course is taught in (for the purpopse of this lesson plan, we will assume English). Students need to have basic familiarity with the food item used (see below).
The teacher should understand basic programming concepts before teaching this class. The teacher will require one assistant to act as the 'computer'; this assistant can be another teacher, an assistant teacher, college student, parent volunteer, etc. This person may need to be coached in the importance of following all of the instructions the students write literally.
If any of the students are severely allergic to peanuts, substitute a cream cheese and jelly sandwich for a peanut butter and jelly sandwich. If you need to avoid the bread, use bumps on a log (celery with peanut butter and raisins). Beyond avoiding food allergy issues in the class, there are no particular safety concerns.
Discuss the following topics: what is a computer, what is programming, and what is a robot. Explain the idea of programming a human 'robot' to make a peanut butter and jelly sandwich (or equivalent). Remind the students that a computer does exactly what you tell is to do. Assign students into teams for the exercise (minimum 3 per team, maximum 6; Minimum of 2 teams, maximum of 3).
Physical Modeling and Measurement
Explain the following to the groups: Each group will write a program for the robot to make a peanut butter and jelly sandwich, each robot will attempt to follow their groups' program in turn, groups are encouraged to observe and learn from other groups' attempts. Each group will be given a small chalkboard/whiteboard or a section of a larger one to work on their program. The group that says they have their program ready first will have theirs tested first.
Discuss the following subjects with the class: what was difficult about the activity, what are computers so literal, what did they learn from the activity, what would they like to know more about concerning the activity. After the discussion is finished give some real-world examples and give the students an idea of where to go if they want to learn more.