🎯 Learning Objectives
Develop the Algorithms Learning Strand:
- Understand what an algorithm is.
- Understand that when computer programs produce unexpected outputs they could be due to bugs in programming code.
- Create a simple flow chart using input, output, process and decisions.
💬 Key Vocabulary
- Algorithm
- Input
- Process
- Output
- Decision
- Bug
📝 Starter Activity – Algorithms
- An algorithm is a series of step by steps instructions which solve a problem.
- We follow algorithms everyday, for example when making a cup of tea.
- Get a cup
- Get a teabag
- Get the milk out of the fridge
- Get the sugar
- Put water in the kettle
- Turn on the kettle
- Put the teabag in the cup
- Put the boiling water from the kettle into the cup
- Wait for a minute
- Take the teabag out of the cup
- Put a dash of milk into the cup
- Put a teaspoon of sugar into the cup
- DRINK!
- Write down the steps to other algorithm that you follow.
📖 Flowcharts
- A flowchart is a type of diagram that represents an algorithm, workflow or process, showing the steps as boxes of various kinds, and their order by connecting them with arrows.
- Each shape represent some steps in the algorithm:
- The following is a simple example of using flowchart to show the steps in a calculator:
🥈 Silver – Flowcharts
- Use the symbols above to design a flow chart which shows the algorithm for a task that you regularly perform.
- Download the worksheet below to do this.
📖 Bugs
- A bug is an error in a computer program.
- Sometimes a bug may cause a computer program to stop running altogether, this is called a syntax error.
- At other times a bug may cause an unexpected output to be given by a system, for example:
- If we asked a computer program to carry out the calculation 5 + 4 and it output 10 this would show us that there was a bug in our program. This kind of error is called a logic error.
- It is important to test programs to try to remove any bugs before we start to use it.
- One method of reducing the number of bugs in our program is to plan out the processes before we start to write our actual program. One way of doing this is to use a flow chart.
🥇 Gold – Find the Bugs
- The algorithms in the worksheet below each contain a bug which makes them produce unexpected outputs. These are known as logic errors. Can you identify the bugs and suggest a way that they could be fixed?
- Download the worksheet below to do this.
🥉 Platinum – Design a Flowchart
- This activity has been created to allow you to practise designing your own flowchart. Below are the instructions for a mind-reading maths trick, which can be carried out in the non-digital world or by a computer. You must decide on the correct sequence for this maths trick, and think about any variables, inputs, and outputs that you might need.
In this lesson, you…
- Looked at flowcharts and how to create and interpret them.
- Found and fixed bugs in code.
Next lesson, you will…
- See how to create binary numbers using the micro:bit.
- Use LEDs to create output.
🏅 Badge it
🥈 Silver Badge
- Upload a screenshot of your Silver activity to Bourne to Learn.
🥇 Gold Badge
- Upload a screenshot of your Gold activity to Bourne to Learn.
🥉 Platinum Badge
- Upload a screenshot of your Platinum activity to Bourne to Learn.