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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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).
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, thenIF 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 <- USERINPUTIF 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
- Computational thinking through abstraction, decomposition and algorithmic thinking, and understanding what an algorithm is and the difference between an algorithm and a program.
A focused answer to AQA GCSE Computer Science 3.1.1, covering abstraction, decomposition and algorithmic thinking, what an algorithm is, and how an algorithm differs from a program.
- Understand and explain how the linear search and binary search algorithms work, trace each one, and compare them including the requirement that binary search needs a sorted list.
A focused answer to AQA GCSE Computer Science 3.1.3, covering how linear search and binary search work, how to trace each one, and how they compare including why binary search needs a sorted list.
- Understand and explain how the bubble sort and merge sort algorithms work, trace each one, and compare them in terms of method and efficiency.
A focused answer to AQA GCSE Computer Science 3.1.4, covering how bubble sort and merge sort work, how to trace each one, and how they compare in method and efficiency.
- Use the three programming constructs of sequence, selection and iteration, including definite and indefinite iteration, and nest them.
A focused answer to AQA GCSE Computer Science 3.2.2, covering the three programming constructs of sequence, selection and iteration, the difference between definite and indefinite iteration, and nesting.
Sources & how we know this
- AQA GCSE Computer Science (8525) specification — AQA (2020)