Skip to main content
EnglandComputer ScienceSyllabus dot point

How do we write down an algorithm clearly before we code it?

Represent and interpret algorithms using flowcharts and pseudocode, recognise the standard flowchart symbols, and read and write AQA-style pseudocode.

A focused answer to AQA GCSE Computer Science 3.1.2, covering how to represent algorithms with flowcharts and pseudocode, the standard flowchart symbols, and reading and writing AQA-style pseudocode.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Flowcharts
  3. Pseudocode
  4. Why use them
  5. Showing the three constructs in pseudocode
  6. Try this

What this dot point is asking

AQA wants you to represent algorithms as flowcharts and as pseudocode, recognise the standard flowchart symbols, and be able to read and write the AQA pseudocode used in the exam.

Flowcharts

A flowchart is a diagram that shows the steps of an algorithm using standard symbols joined by arrows that show the order of flow (the direction of execution).

flowchart TD A([Start]) --> B[/Input number/] B --> C{number > 10?} C -->|Yes| D[/Output "big"/] C -->|No| E[/Output "small"/] D --> F([Stop]) E --> F

Pseudocode

AQA publishes its own pseudocode notation for the exam, and you should learn it because questions are marked against it. The same example as the flowchart above looks like this in AQA-style pseudocode:

number <- USERINPUT
IF number > 10 THEN
    OUTPUT 'big'
ELSE
    OUTPUT 'small'
ENDIF

The arrow <- is the assignment operator, IF/ELSE/ENDIF shows selection, and indentation shows which statements belong inside the IF. Other AQA keywords include WHILE/ENDWHILE and REPEAT/UNTIL for condition-controlled loops, FOR/ENDFOR for count-controlled loops, and MOD and DIV for the remainder and whole-number parts of a division.

Why use them

Both flowcharts and pseudocode let you plan and check an algorithm before writing real code, spotting logic errors early, and they let other people understand the design without knowing your chosen language. Flowcharts are visual and good for showing flow; pseudocode is compact and translates quickly into real code.

Showing the three constructs in pseudocode

Flowcharts and pseudocode can both express the three programming constructs, and the exam expects you to recognise them in either form. Sequence is simply statements written one after another. Selection is shown by a decision diamond in a flowchart, or IF/ELSE/ENDIF (or CASE) in pseudocode. Iteration is shown by an arrow looping back in a flowchart, or by FOR/ENDFOR (a known count), WHILE/ENDWHILE (test before the body) or REPEAT/UNTIL (test after the body) in pseudocode. Being fluent in both representations lets you convert a diagram to pseudocode and back, which is a common exam task, and helps you spot when a flowchart's loop-back arrow corresponds to a particular kind of loop.

Try this

Q1. State the flowchart symbol used for a decision and how many arrows leave it. [2 marks]

  • Cue. A diamond, with two arrows out (for example Yes and No).

Q2. Write AQA-style pseudocode that inputs a number and outputs whether it is positive. [2 marks]

  • Cue. num <- USERINPUT, then IF num > 0 THEN OUTPUT 'positive' ENDIF.

Exam-style practice questions

Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

AQA 20194 marksWrite an algorithm, using AQA-style pseudocode, that inputs a whole number and outputs whether it is even or odd. Use the MOD operator.
Show worked answer →

A correct solution tests the remainder when the number is divided by 2:

num <- USERINPUT
IF num MOD 2 = 0 THEN
OUTPUT 'even'
ELSE
OUTPUT 'odd'
ENDIF

Markers reward using USERINPUT and the assignment arrow, the correct condition (num MOD 2 = 0 for even), both output branches, and the closing ENDIF. Indentation showing what belongs inside the IF is expected.

AQA 20225 marksA flowchart describes an algorithm that repeatedly asks for a password until the correct one is entered. Describe the standard flowchart symbols you would use, and explain which symbol controls the repetition.
Show worked answer →

Use an oval (terminator) for start and stop, a parallelogram for inputting the password and for any output message, a rectangle for any process step, and a diamond for the decision "password correct?".

The diamond controls the repetition: it has two labelled outputs. The "No" arrow loops back to the input parallelogram so the user is asked again, and the "Yes" arrow continues to the stop. This loop-back from the decision is what creates the repeated asking.

Markers reward the correct symbols matched to their roles and identifying the decision diamond with its loop-back arrow as the control of the repetition.

Related dot points

Sources & how we know this