Create Algorithms for a Computer that Follow a Sequence
Learn about algorithms and follow an algorithm to make a s’more.
Adapted from step 1 of the Daisy Coding Basics badges.
Purpose: Learn about algorithms and follow an algorithm to make a s’more.
Setup: Computer scientists write code to tell computers what to do. They do this in different ways. For example, they may write a list of steps to solve a problem or complete a task. These lists of steps are done in the order that an event should happen. The list of steps is called an algorithm. The order the steps are done in is called the sequence. Once you know what an algorithm is, you can then write or follow one to complete any type of task!
Time needed: 15 minutes
- 1 graham cracker
- 1 piece of chocolate
- 1 marshmallow
- 1 plate
- 1 napkin
A recipe is a great example of an algorithm: it’s a list of steps to complete a task! In this case, the task is making a s’more, and the recipe is the list of steps that tells you how to do that.
Follow the steps of this algorithm to make a s’more:
Step 1: Take one marshmallow out of the bag and set it on your plate.
Step 2: Take one graham cracker out of the bag and break it in half.
Step 3: Set the halves on your plate.
Step 4: Unwrap a piece of chocolate.
Step 5: Set the chocolate on your plate.
Step 6: Put your marshmallow on one graham cracker half.
Step 7: Put your chocolate on top of the marshmallow.
Step 8: Put the other graham cracker half on top of the chocolate.
Step 9: Take a bite!