Lesson 2.2: The Great Peanut Butter Sandwich Challenge

Get ready for the messiest, funniest, and most delicious challenge yet! Today, you’ll write the perfect algorithm for a simple task: making a peanut butter and jelly sandwich. But will your instructions be clear enough for a computer (or your teacher!) to follow?

What You’ll Learn

By the end of this challenge, you’ll be able to:

  • Write a super detailed, step-by-step algorithm that anyone can follow.
  • See with your own eyes why being precise is so important in programming.
  • Connect the fun of writing a recipe to the real work of writing code.
  • Get even better at giving crystal-clear instructions.

The Challenge Plan

Mission Briefing (10 minutes)

  • Let’s quickly review: what’s an algorithm?
  • Today’s mission is presented: Write a perfect, complete set of instructions on how to make a PB&J sandwich.
  • The #1 rule is announced: The person making the sandwich can ONLY do exactly what is written. No guessing!
  • We’ll quickly go over the safety rules for our sandwich-making station.

Algorithm Writing Time (15 minutes)

  • It’s time to write your masterpiece. You can work alone or with a partner.
  • Use the algorithm worksheet to help you structure your steps.
  • Think about every single tiny detail! Don’t leave anything out.

The Hilarious Test Kitchen (20 minutes)

  • This is the best part! Your teacher (or a brave volunteer) will attempt to follow some of your algorithms, word for word.
  • Get ready to laugh as you see what happens when an instruction is missing or unclear. (Did you remember to tell them to open the jar?)
  • We’ll take notes on what works and what doesn’t, celebrating both the perfect sandwiches and the funny messes!

Algorithm Upgrade (10 minutes)

  • Based on what you saw, it’s time to revise your algorithm.
  • Add more detail, fix unclear steps, and make your instructions foolproof.
  • Share your new-and-improved algorithms with a partner.

Connecting to Code (5 minutes)

  • Let’s talk about how this crazy sandwich challenge is exactly like real computer programming.
  • We’ll get a sneak peek at the programming tools we’ll use in the coming weeks.

Your Challenge Supplies

  • Bread, peanut butter, jelly, plastic knives, and paper plates
  • Napkins and cleaning supplies (just in case!)
  • Algorithm worksheets for your master instructions
  • A big piece of paper to display any perfect sandwich algorithms
  • A picture of what real programming blocks look like

How to Win the Challenge

  • The ultimate test is seeing your algorithm in action. How clear were your original instructions?
  • The Upgrade Award: We’ll compare your first draft to your final, revised algorithm to see how much you improved as a programmer!

Safety First!

  • We will check for any food allergies before we begin.
  • We will only use plastic knives.
  • We’ll have hand sanitizer ready for everyone.
  • Allergy-friendly options (like sunflower seed butter) will be available.

New Tech Words to Master

  • Precise: Being super specific and exact. No room for guessing!
  • Revise: To look back at your work and make it better.
  • Debug: You’ll be doing this live when you see a problem and think about how to fix your instructions!