## Programming theory - Flowcharts

**Learning Objectives:**

- Understand algorithms (written in pseudocode or flow diagram), explain what they do, and correct or complete them
- Produce algorithms in pseudocode or flow diagrams to solve problems

Suggested time: 50 mins

**Starter**

Start by showing students the following clip from an episode of the Big Bang Theory in which Sheldon shows his friendship algorithm in the form of a flowchart. (Thanks to Phil Smith for suggesting this one via CAS)

*The Big Bang Theory - The friendship algorithm*

Explain that an algorithm is simply a sequence of steps for completing a task. Also explain that algorithms can be represented in many ways, the most commonly used being flow charts and pseudocode.

Follow this by going through an example on the board (see below).

**Introduction:**Explain that an algorithm is simply a sequence of steps for completing a task. Also explain that algorithms can be represented in many ways, the most commonly used being flow charts and pseudocode.

Follow this by going through an example on the board (see below).

Next, display a set of the most commonly used flowchart symbols on the board and explain what they mean (see below). Challenge the students to give examples of how each symbol might be used – giving prompts where necessary.

**Activity 1: (Interactive Challenge)**

Follow the introduction with two matching exercises (Source: clickschool.co.uk - see below.

*requires flash.*

**Note:**In the first matching exercise, students must match the flowchart symbols to their names. In the second exercise, students are challenged to complete a given flowchart by placing the events in the correct order.

matching_activity.zip | |

File Size: | 68 kb |

File Type: | zip |

With input from the students, go through the solution to the second matching exercise - “going to school”. Next, ask students to suggest what daily routines are missing from the example.

Place students into small groups and ask them to improve the algorithm for getting up and going to school in the morning (in the form of a flowchart).

Whilst the students are busy creating their flowcharts, wander around the classroom and pick out the group with most complex solution then invite that group to replicate their flowchart on the whiteboard and explain their solution to the rest of the class. As the group explain their solution, with the aid of the class, correct any errors and highlight any misconceptions.

Wait for the group to fill the whiteboard, at which point, stop them and ask the rest of the class to suggest how the solution could be simplified / cleaned up. This is where you introduce the flowchart symbol for sub-routines (see below).

**Activity 2:**With input from the students, go through the solution to the second matching exercise - “going to school”. Next, ask students to suggest what daily routines are missing from the example.

Place students into small groups and ask them to improve the algorithm for getting up and going to school in the morning (in the form of a flowchart).

**You can get the students to write down any algorithm (e.g. making the tea, tying a shoelace, making a jam sandwich etc.) however, I find, the more complex the algorithm, the easier it is to explain the need for sub-routines later in the lesson. The going to school algorithm is great for demonstrating this as you can have several sub-routines for brushing your teeth, taking a shower, making breakfast etc. Also, try to encourage your students to make their algorithms as detailed as possible - this will also help with explaining the need for sub-routines later.***Tip:***Activity 3:**Whilst the students are busy creating their flowcharts, wander around the classroom and pick out the group with most complex solution then invite that group to replicate their flowchart on the whiteboard and explain their solution to the rest of the class. As the group explain their solution, with the aid of the class, correct any errors and highlight any misconceptions.

Wait for the group to fill the whiteboard, at which point, stop them and ask the rest of the class to suggest how the solution could be simplified / cleaned up. This is where you introduce the flowchart symbol for sub-routines (see below).

Ask the students to suggest the possible benefits of using sub-routines and wait for answers such as “easier to understand” and “several people can work on the same algorithm at the same time”. Finish by asking the students to modify their solutions to include at least one sub-routine.

The friendship algorithm - Clip from an episode of the Big Bang Theory in which Sheldon shows his friendship algorithm in the form of a flowchart.

BBC Byte Size (System Flowcharts)

Algorithms in pseudocode and flow diagrams - Lesson plan on algorithms in pseudocode and flow diagrams.

Algorithms in pseudocode and flow diagrams - This video, presented by Clive Beale of the Raspberry Pi Foundation, looks at good practice in the techniques of writing pseudocode and producing flow diagrams.

Teach-ICT (Flowcharts)

There are several ways in which you can introduce flowcharts. Here are some alternatives to the ones I suggested:

In this exercise, students are asked to create an algorithm from set commands to program their teacher (sandwich bot) to make a jam sandwich. Students must write a set of working instructions, using commands such as Pick Up and Put Down, which their teacher has to follow precisely in order to make a jam sandwich. This task can be easily adapted to incorporate flowcharts and is great for introducing algorithms (at any age)! To find out more, check out this lesson plan, courtesy of Phil Bagge, CAS Primary Master Teacher (@baggiepr): Jam Sandwich Algorithm (programming teacher bot)

This is a starter activity I use to introduce algorithms. Print and cut out the attached instructions for making a cup of tea. Instruct students to put the instructions in the correct order. The “Making the Tea” exercise has been doing the rounds for sometime. I remember doing it at college back in the early 90’s. What I find interesting is seeing all the different variations for such as simple task.

**Activity 4:**Ask the students to suggest the possible benefits of using sub-routines and wait for answers such as “easier to understand” and “several people can work on the same algorithm at the same time”. Finish by asking the students to modify their solutions to include at least one sub-routine.

**Resources:**The friendship algorithm - Clip from an episode of the Big Bang Theory in which Sheldon shows his friendship algorithm in the form of a flowchart.

BBC Byte Size (System Flowcharts)

Algorithms in pseudocode and flow diagrams - Lesson plan on algorithms in pseudocode and flow diagrams.

Algorithms in pseudocode and flow diagrams - This video, presented by Clive Beale of the Raspberry Pi Foundation, looks at good practice in the techniques of writing pseudocode and producing flow diagrams.

Teach-ICT (Flowcharts)

**Alternative Activities:**There are several ways in which you can introduce flowcharts. Here are some alternatives to the ones I suggested:

*1. Jam Sandwich activity.*In this exercise, students are asked to create an algorithm from set commands to program their teacher (sandwich bot) to make a jam sandwich. Students must write a set of working instructions, using commands such as Pick Up and Put Down, which their teacher has to follow precisely in order to make a jam sandwich. This task can be easily adapted to incorporate flowcharts and is great for introducing algorithms (at any age)! To find out more, check out this lesson plan, courtesy of Phil Bagge, CAS Primary Master Teacher (@baggiepr): Jam Sandwich Algorithm (programming teacher bot)

*2. Making the tea starter.*This is a starter activity I use to introduce algorithms. Print and cut out the attached instructions for making a cup of tea. Instruct students to put the instructions in the correct order. The “Making the Tea” exercise has been doing the rounds for sometime. I remember doing it at college back in the early 90’s. What I find interesting is seeing all the different variations for such as simple task.

**If your students are feeling really confident, you could challenge them to create a BS 6008 compliant algorithm for making the tea!***Extension task:* making_the_tea_print.docx | |

File Size: | 42 kb |

File Type: | docx |

making_the_tea_solution.docx | |

File Size: | 43 kb |

File Type: | docx |

making_the_tea_task.docx | |

File Size: | 42 kb |

File Type: | docx |

Here are a set of Flowchart tasks for simple activities (making tea, coffee, pizza, lasagna etc.) courtesy of David Barnard (via CAS). Includes a differentiated version of the making tea exercise. (Requires you to login to the CAS community - FREE)

**3. More flowchart tasks.**Here are a set of Flowchart tasks for simple activities (making tea, coffee, pizza, lasagna etc.) courtesy of David Barnard (via CAS). Includes a differentiated version of the making tea exercise. (Requires you to login to the CAS community - FREE)

**Tags:**GCSE Computer Science, Algorithms, Pseudocode, Computing