Steps in Order: Make a Jam Sandwich
Byte the friendly robot stands at a sunny kitchen table, pointing at three picture cards that show how to make a jam sandwich step by step.
- Name what a program is in simple words.
- Put picture steps in the correct order, from first to last.
- Explain that a computer does one step at a time and cannot skip ahead.
- Show that changing the order of steps can break a program.
- Follow a short list of steps in order to finish a task.
Key terms
- program
- a list of steps a computer follows one at a time
- step
- one single instruction inside a program
- order
- the position of each step, from first to last
- sequence
- a set of steps lined up to run in order
One Step at a Time
A computer is patient but very simple. It does exactly one step before it moves to the next. It reads step 1 and finishes it, then it reads step 2 and finishes that, and so on down the list. A computer never skips ahead to a step it likes better, and it never jumps backward. Because of this, the steps you write must be complete and clear, since the computer will only do what each step actually says.
Why the First Step Comes First
Each step often depends on the step before it. You cannot spread jam until you are holding the bread, and you cannot close the sandwich until the jam is on. This is why order matters so much. If you put the spread-jam step before the pick-up-bread step, the jam lands on the table and the sandwich is ruined. The right order makes sure every step has what it needs from the steps that came before it.
Worked examples
Put the jam sandwich steps in the right working order.
- Ask what comes first: you need bread in your hand, so step 1 is pick up the bread.
- Ask what comes next: now that you hold the bread, step 2 is spread the jam on it.
- Ask what comes last: with jam on, step 3 is close the sandwich and eat it.
Answer: 1) Pick up the bread, 2) spread the jam, 3) close the sandwich and eat — that order makes a real sandwich.
Activity
Drag the sandwich steps into the right order, from first to last.
Practice
Write the three steps to brush your teeth in the correct order from first to last.
Tell what would go wrong if you put your shoes on before your socks.
Common mistakes to avoid
- The order of steps does not matter.Order matters because each step often needs the result of the step that came before it.
- A computer can guess the missing steps.A computer only does what each step says and cannot guess steps you forgot to write.
Check your understanding
What is a program?
Does the order of steps in a program matter?
Byte the robot reads a program that has 3 steps. Which step does Byte do first?
Recap
A program is a list of steps that a computer follows one at a time, always in order. It never skips ahead and never jumps back. Because each step often depends on the step before it, putting the steps in the right order is what makes the program finish the task correctly.
Reflect
Think of a task you do every morning: what is its very first step, and why?