Follow & Write Algorithms (Edexcel GCSE Computer Science)

Revision Note

James Woodhouse

Written by: James Woodhouse

Reviewed by: Lucy Kirkham

What is an algorithm?

  • An algorithm is precise set of rules or instructions to solve a specific problem or task

  • There are two main ways to write an algorithm

    • Flowchart

    • Pseudocode

Flowcharts

What is a flowchart?

  • Flowcharts are a visual tool that uses shapes to represent different functions to describe an algorithm

  • Flowcharts show the data that is input and output, the processes that take place and any decisions or repetition

  • Lines are used to show the flow of control

flow-chart-symbols

Example

Flowchart

flow-chart-1
  • The casino would like the algorithm refined so that the user also enters their first name and this is used to greet the user when they access the site

Flowchart

flow-chart-2-1

Pseudocode

What is pseudocode?

  • Pseudocode is a text-based tool that uses short English words/statements to describe an algorithm

  • Pseudocode is more structured than writing sentences in English but is very flexible

  • In exams, pseudocode will appear in the format of Python 3 as per the Programming Language Subset (PLS) document from Edexcel

Example

  • A casino would like a program that asks users to enter an age, if they are 18 or over they can enter the site, if not then they are given a suitable message

Pseudocode

age = int(input("Enter age "))

if age >= 18:

print("Welcome to the site")

else:

print("Sorry, this site is for users 18 and over"

  • The casino would like the algorithm refined so that the user also enter their first name and this is used to greet the user when they access the site

Pseudocode

fname = input("Enter first name ")

age = int(input("Enter age")

if age >= 18:

print ("Welcome to the site" + fname)

else:

print ("Sorry, this site is for users 18 and over")

  • Practical use of Pseudocode is covered in section 6 here

Last updated:

You've read 0 of your 5 free revision notes this week

Sign up now. It’s free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

James Woodhouse

Author: James Woodhouse

Expertise: Computer Science

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.

Lucy Kirkham

Author: Lucy Kirkham

Expertise: Head of STEM

Lucy has been a passionate Maths teacher for over 12 years, teaching maths across the UK and abroad helping to engage, interest and develop confidence in the subject at all levels.Working as a Head of Department and then Director of Maths, Lucy has advised schools and academy trusts in both Scotland and the East Midlands, where her role was to support and coach teachers to improve Maths teaching for all.