teach-ict.com logo

THE education site for computer science and ICT

2. Setting out an algorithm

An algorithm breaks down a task into a series of steps.

For example, let's take making a sandwich. What steps do you need to follow?

  • Fetch two slices of bread
  • Fetch knife
  • Spread butter on each slice of bread
  • Place one slice of bread on a plate with the buttered side facing up
  • Add 1 slice of ham on top of the buttered bread
  • If required add mustard
  • Put second slice of bread on top of ham (with buttered side facing towards ham)
  • Use knife to cut bread diagonally in half

There are lots of stages to this simple task. Some of them need to be done in a certain order. For example, you need to get the knife before you can butter the bread. You need to add the ham before you can cut the sandwich. There are also choices to be made such as the mustard.

Flow charts are useful for laying out the process as a visual diagram.



Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: what is a flowchart