Flowcharts and pseudocode Cambridge IGCSE Computer Science revision

Not started

Learn it

In plain words

An algorithm is a set of steps for solving a problem. Before it is turned into program code, it is written down in one of two ways: as a flowchart, which is a picture, or as pseudocode, which is structured text.

6 things to know

  1. Flowchart symbols. A box with rounded ends (the terminator) for Start and Stop. A parallelogram for input and output. A rectangle for a process, such as a calculation. A diamond for a decision.
  2. A decision has one way in and two ways out, labelled Yes and No. Arrows, called flow lines, show the order of the steps.
  3. Pseudocode uses keywords in capitals, such as INPUT, OUTPUT, IF and WHILE.
  4. The arrow ← means "is given the value of". Total ← Total + 5 means: work out Total + 5 and store the answer back in Total.
  5. Algorithms must be precise. Write Mark > 50, not "Mark is greater than 50".
  6. To state the purpose of an algorithm, say what it achieves overall, such as "it finds the largest of ten numbers", not what each line does.

Worked example

An algorithm inputs a number and outputs "High" if it is more than 100, and "Low" if not. Which flowchart symbols are needed, in order?

  1. Start: a terminator.
  2. INPUT Number: a parallelogram.
  3. Is Number > 100?: a diamond, with a Yes arrow and a No arrow coming out.
  4. OUTPUT "High" on the Yes arrow and OUTPUT "Low" on the No arrow: two parallelograms.
  5. Stop: a terminator.

Tips and tricks

  • Label both exits from every decision with Yes and No. An unlabelled decision cannot be followed, and loses marks.
  • Input and output share one shape, the parallelogram. Calculations go in rectangles.
6 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Flowcharts and pseudocode: 6 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. Which flowchart symbol is used for a decision?
    • a rectangle
    • a parallelogram
    • a diamond (the answer)
    • a circle

    It has two exits: Yes and No.

  2. Which flowchart symbol is used for input and output?
    • a rectangle
    • a parallelogram (the answer)
    • a diamond
    • a box with rounded ends

    The same shape is used for both.

  3. Which flowchart symbol is used for a calculation?
    • a rectangle (the answer)
    • a parallelogram
    • a diamond
    • a box with rounded ends

    A calculation is a process.

  4. What does the arrow in Price ← 20 mean?
    • Price is less than 20.
    • The value 20 is stored in Price. (the answer)
    • Price is tested against 20.
    • 20 is output.

    The value on the right is stored in the variable on the left.

  5. Which is written precisely enough for pseudocode?
    • make the total bigger
    • add up everything
    • Total ← Total + Number (the answer)
    • the total goes up

    Each step must be exact.

  6. What do the flow lines of a flowchart show?
    • the size of the program
    • the order in which the steps are carried out (the answer)
    • the data types of the variables
    • the errors in the algorithm

    Follow the arrows from Start to Stop.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf