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

Think, then code

Week 14 · Unit 6: Be a storyteller · 3 lessons
1

Think in the right order

Computing 3: Unit 6, pp. 93–104
GoalUse logical thinking to break a job into steps and put the steps in an order that works.
New words
logical thinking · working out a problem so that every step makes sensebreak down · to split a big job into small piecesorder · which step comes first, which comes next and which comes last
Explanation

We write an algorithm to solve a problem or do a job. Logical thinking helps us to write a good one. First, understand the problem. Next, break the job down into small pieces. Then think about the steps each piece needs. Last, put the steps in an order that makes sense. Some steps must come before others. You cannot water a seed before the soil is in the pot. Ask yourself: “Can I do this step yet?”

StepInstruction
1Put soil in the pot
2Push a bean seed into the soil
3Pour in a little water
4Put the pot next to a sunny window
Worked examples
StepInstruction
1Get the fruit
2Wash the fruit
3Cut the fruit with an adult
4Put the pieces in a bowl
5Mix and serve
Nodira breaks down “make a fruit salad” into pieces: get the fruit, wash it, cut it (an adult helps with the knife), put it in a bowl and mix. She puts the pieces in order. Washing comes before cutting, and the bowl comes before mixing.
write messagewrite addressstick on stamppost it
Some steps can swap and some cannot. To send a postcard, writing the message and writing the address can swap. The stamp must be on before the card is posted, and posting is always last.
StepInstruction
1Put on an apron
2Wash the brush
3Paint the picture
When the order is wrong, the result is wrong. This painting algorithm has a mistake: the brush is washed before any painting is done. Painting must come before washing the brush.
Class activity

Cut-up steps (in groups): write the steps for making a cold sandwich on separate strips of paper: wash hands, take two slices of bread, spread butter on one slice, add the filling, put the slices together, put the sandwich on a plate. Mix the strips up. Another group puts them in order, using logical thinking. Ask: which two strips could swap? Which one must always come first? Then swap jobs with another group and try a new task, such as “draw a house”.

Practice
1
Put these steps in order for washing a bicycle: (a) dry it with a cloth (b) rinse it with water (c) scrub it with a soapy sponge (d) fill a bucket with soapy water.
2
Break the job “draw a flower” into four pieces.
3
Which step is in the wrong place? How should the algorithm be fixed?
StepInstruction
1Pour water on the plant
2Fill the can with water
3Carry the can to the plant
4
Which two steps can swap places without changing the result? Which step must stay first, and which must stay last?
StepInstruction
1Put a cloth on the table
2Put out the forks
3Put out the spoons
4Call everyone to eat