AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Clear instructions

Week 1 · Unit 1: Be a game developer · 3 lessons
2

Steps in the right order

Computing 2: Unit 1, pp. 8–23
GoalPut the steps of an algorithm in the right order and say why the order matters.
New words
order · which step comes first, next and lastresult · what you get at the endswap · to change the places of two things
Explanation

The steps of an algorithm must be in the right order. If the order is wrong, the result is wrong. Think about getting ready to go out. You put on your socks first and then your shoes. If you put your shoes on first, the socks go on top of the shoes! A computer follows the steps one by one, from the first to the last. It never changes the order for you.

1 socks2 shoes
Worked examples
1 fill pot with soil2 put in the seed3 add water
Planting a seed: first fill the pot with soil, next put in the seed, last add water. This is the right order.
StepAli’s algorithmBetter algorithm
1Eat the soupPour the soup into a bowl
2Pour the soup into a bowlEat the soup
Ali writes the steps for a bowl of soup. His order is wrong. He cannot eat the soup before it is in the bowl, so the steps must swap.
Some steps can swap places and some cannot. You can put your hat on before or after your coat. But you cannot tie your shoelaces before the shoes are on your feet.
Class activity

Order cards: on five small pieces of paper write these steps for washing your hands: turn on the tap, wet your hands, rub soap on your hands, rinse the soap off, dry your hands. Mix up the cards. A friend puts them in the right order. Then swap two cards on purpose and read the algorithm out loud. What goes wrong?

Practice
1
Put these steps in the right order: A Eat the apple. B Wash the apple. C Pick up the apple.
2
Put the steps for making a cheese sandwich in the right order.
A eat itC get two slices of breadB put cheese on one slice
3
Why must a computer follow the steps in the right order?
4
Malika writes: 1 Put the bread in the toaster. 2 Spread butter on the toast. 3 Push the lever down. Which two steps should swap?
StepMalika’s algorithm
1Put the bread in the toaster
2Spread butter on the toast
3Push the lever down