How do you design an algorithm using pseudocode and flowcharts, and how do you trace one to check it works?
Designing, expressing and tracing algorithms using pseudocode and flowcharts, and using a trace table to follow an algorithm step by step.
An Eduqas GCSE Computer Science answer on designing and expressing algorithms in pseudocode and flowcharts, the standard flowchart symbols, and using a trace table to follow an algorithm step by step and find its output.
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
Eduqas wants you to design and express algorithms in pseudocode and flowcharts, know the standard flowchart symbols, and trace an algorithm with a trace table to find its output and check it works. Trace-table questions in particular are worth several method marks and appear regularly.
Pseudocode and flowcharts
A simple pseudocode algorithm to find the larger of two numbers:
input a
input b
if a > b then
output a
else
output b
endif
The flowchart symbols
Trace tables
The same algorithm as a flowchart
The summing algorithm above can be drawn as a flowchart: a terminator (start), a process to set total = 0 and i = 1, a decision diamond asking "is i more than 4?", and if not, a process total = total + i then i = i + 1 with an arrow looping back to the decision. When the decision is yes, an input/output symbol outputs total, and a final terminator ends it. The flowchart and the pseudocode describe exactly the same steps; the flowchart makes the loop and the decision easy to see, while the pseudocode is quicker to write and closer to code.
Try this
Q1. State which flowchart symbol represents a decision. [1 mark]
- Cue. A diamond (a yes/no branch).
Q2. State what a trace table is used for. [1 mark]
- Cue. To follow an algorithm step by step by recording the variables, to check it works and find its output.
Q3. For the algorithm x = 5; x = x + 3; x = x * 2; output x, state the output. [2 marks]
- Cue. , then , then ; output .
Exam-style practice questions
Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Eduqas Component 1, 20225 marksComplete a trace table for the following algorithm and state the final output. total = 0; for i = 1 to 4; total = total + i; next i; output total.Show worked answer →
Build a trace table with columns for i and total, writing a row each time the loop body runs.
Start: total = 0. Pass 1: i = 1, total = 0 + 1 = 1. Pass 2: i = 2, total = 1 + 2 = 3. Pass 3: i = 3, total = 3 + 3 = 6. Pass 4: i = 4, total = 6 + 4 = 10.
Final output: 10. Markers award marks for the correct values of i and total at each pass and the final output. A common error is starting i at 0 or stopping after three passes.
Eduqas Component 1, 20234 marksDescribe the purpose of the standard flowchart symbols for a terminator, a process, a decision and an input/output, and state how the flow between them is shown.Show worked answer →
Terminator (rounded box/oval): marks the start or end of the algorithm (1 mark).
Process (rectangle): an action or calculation, such as total = total + 1 (1 mark).
Decision (diamond): a yes/no question that branches the flow two ways (1 mark).
Input/output (parallelogram): reading in data or outputting a result; flow is shown by arrows joining the symbols in order (1 mark).
Markers reward each symbol matched to its meaning and the point that arrows show the order of flow.
Related dot points
- Computational thinking: abstraction, decomposition and algorithmic thinking, and how these techniques are used to break down and solve a problem.
An Eduqas GCSE Computer Science answer on computational thinking: abstraction (removing unnecessary detail), decomposition (breaking a problem into smaller parts) and algorithmic thinking (working out the steps), with a worked example of applying all three.
- The linear search and binary search algorithms, how each works, the requirement that binary search needs sorted data, and how their efficiency compares.
An Eduqas GCSE Computer Science answer on the linear and binary search algorithms: how each works step by step, why binary search needs sorted data, and how their efficiency compares.
- The bubble sort and merge sort algorithms, how each puts a list into order, and how their efficiency on large lists compares.
An Eduqas GCSE Computer Science answer on the bubble sort and merge sort algorithms: how each orders a list step by step, a worked bubble-sort pass, and how their efficiency on large lists compares.
- The three programming constructs: sequence, selection (if and nested if) and iteration (count-controlled and condition-controlled loops), and when to use each.
An Eduqas GCSE Computer Science answer on the three programming constructs: sequence, selection (if, else, nested if) and iteration (count-controlled for loops and condition-controlled while loops), with worked pseudocode for each.
- Subprograms (procedures and functions), the difference between them, parameters and arguments, local and global variables, and why subprograms make programs easier to write and maintain.
An Eduqas GCSE Computer Science answer on subprograms: the difference between a procedure and a function, parameters and arguments, local and global variables, and why subprograms support decomposition, reuse and easier maintenance.
Sources & how we know this
- WJEC Eduqas GCSE Computer Science specification (from 2016) — Eduqas (2020)