Representing algorithms — AQA GCSE Computer Science
Representing algorithms involves expressing step-by-step problem-solving methods using standardised flowcharts, pseudocode, or structured written descriptions. Mastering these representations enables students to communicate logic independently of specific programming syntax and accurately trace program execution using trace tables.
Representing algorithms explained
A systematic approach means working through a problem in ordered stages rather than jumping to code.
Read the full explanation
First identify the inputs, the processing and the required outputs, and decompose the problem into manageable sub-tasks. Then design an algorithm step by step, checking each stage against the requirements. Finally represent the algorithm in the required form: pseudo-code using structured constructs such as sequence, selection and iteration; program code in a language you know; or a flowchart using standard symbols for start/end, input/output, process and decision, with arrows showing flow. For example, a program that finds the largest of three numbers needs inputs, comparisons and an output, and each representation must express the same logic.
Your focus
- Apply a systematic approach by identifying inputs, processing and outputs before designing an algorithm.
- Create a correct algorithm and represent it accurately in pseudo-code, program code and a flowchart.
- Explain how each representation conveys the algorithm's logic, including selection and iteration.
Which command word is this?
Fill in missing components in a diagram or table (e.g., trace table values or flowchart symbols) accurately using the provided data.
Representing algorithms exam tips
Topic Overview
Representing algorithms is a foundational topic in AQA GCSE Computer Science that bridges the gap between problem decomposition and writing executable code. It covers the core methods used to plan and document program logic: pseudocode, system flowcharts, and structured natural language.
This topic equips students with the analytical skills needed to trace algorithm execution, identify logic errors, and evaluate efficiency using trace tables. Mastering these concepts ensures students can express complex computational solutions clearly on paper during examinations without depending on a compiler.
Key Concepts
- →Standard Flowchart Symbols: Terminator (start/end oval), Process (rectangle), Input/Output (parallelogram), Decision (diamond), Subroutine (rectangle with double borders).
- →Pseudocode Conventions: Language-independent notation using standard programming constructs like IF-THEN-ELSE, WHILE-ENDWHILE, and FOR-ENDFOR.
- →Trace Tables: Tabular method used for dry-running algorithms to record variable updates and condition outcomes step-by-step.
- →Algorithm Efficiency: Comparing different algorithmic solutions to the same problem in terms of steps required and logic clarity.
Marking Points
- Describes a systematic approach: identifying inputs, processing and outputs before designing the algorithm.
- Decomposes the problem into smaller sub-tasks or steps in a logical order.
- Produces a correct algorithm that solves the stated problem, with correct sequence, selection and iteration as needed.
- Represents the algorithm accurately in pseudo-code, using structured constructs and consistent indentation.
- Represents the algorithm accurately in program code that matches the intended logic.
- Represents the algorithm accurately in a flowchart using correct symbols and directional arrows.
- Explains how the chosen representation shows the logic, such as decisions as diamonds and loops as returning arrows.
- Checks or tests the algorithm against example inputs to confirm it produces the required output.
Examiner Tips
- 💡State your systematic stages briefly before presenting the algorithm so the approach is visible.
- 💡Keep pseudo-code and any flowchart consistent so the logic matches across representations.
- 💡Label decision branches and show loop returns clearly so selection and iteration are unambiguous.
- 💡Test your algorithm with a simple example input and state the expected output to demonstrate correctness.
- 💡In flowchart questions, always check that flow lines have arrowheads showing the exact direction of data flow; lines without arrows lose marks.
- 💡When asked to write pseudocode, use clear indentation for nested constructs like loops and selection to demonstrate structured logical thinking.
- 💡For trace table questions, work systematically line by line; never guess the end state or skip intermediate loop iterations.
Common Mistakes
- Jumping straight to code without identifying inputs, processing and outputs: correction — plan the stages first, then represent the algorithm.
- Mixing representations inconsistently, such as pseudo-code that does not match the flowchart logic: correction — ensure every representation expresses the same algorithm.
- Using incorrect flowchart symbols, such as a rectangle for a decision: correction — use a diamond for decisions and label both branches.
- Omitting iteration or selection where the problem requires it: correction — check the logic includes every needed construct.
- Leaving pseudo-code unstructured with no clear sequence: correction — use indentation and structured constructs to show the flow.
- Confusing assignment ('<-' or '=') with comparison ('=='). In pseudocode and flowcharts, assigning a value changes variable state, whereas comparison yields a Boolean result.
- Believing pseudocode has a single strict syntax like Python; while AQA has standard pseudocode guidelines, examiners award marks for correct logic rather than exact syntax memorisation.
- Assuming trace tables must have every variable written on every single row, which clutters the trace and leads to marking errors; variables should only be updated on the line their value changes.
Revision Plan
- 1Day 1-3: Memorise and practice drawing all standard flowchart symbols and complete 5 flowchart-to-pseudocode translation drills.
- 2Day 4-6: Practice dry-running algorithms using past-paper trace tables involving count-controlled and condition-controlled loops.
- 3Day 7-10: Write pseudocode solutions for common problem patterns (linear search, finding maximum/minimum, running totals, validation).
- 4Day 11-14: Complete mixed-topic exam questions under timed conditions, cross-referencing answers with official AQA mark schemes.
Exam Question Types
- 📋Flowchart Completion: Adding missing symbols, conditions, or directional arrows to an incomplete flowchart.
- 📋Trace Table Construction: Dry-running a given pseudocode algorithm with test inputs and tracking variable states.
- 📋Pseudocode Writing: Designing an algorithm from a written scenario using sequence, selection, and iteration.
- 📋Error Identification / Correction: Spotting logic errors (such as off-by-one errors or incorrect relational operators) in a given algorithm.
Command Word Expectations (AQA)
Fill in missing components in a diagram or table (e.g., trace table values or flowchart symbols) accurately using the provided data.
Produce a coherent algorithm in pseudocode or program code that fully solves the problem specification and handles edge cases.
Provide a detailed account of an algorithm's operation or how a specific construct achieves a task without needing to write full code.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: An algorithm needs to ask a user to enter a positive integer. If the integer is negative or zero, it must output an error and prompt again until a valid positive integer is entered. Write pseudocode to represent this algorithm using AQA standard pseudocode.
- 1.Step 1: Determine the loop structure required. Since the input must be requested at least once before checking validity, a post-condition loop or an initial input followed by a WHILE loop is suitable. We will use a standard pre-tested WHILE loop.
- 2.Step 2: Initialize the variable by taking the first input: 'num <- USERINPUT'.
- 3.Step 3: Define the condition to check if the number is invalid: 'num <= 0'.
- 4.Step 4: Inside the loop, output an error message: 'OUTPUT 'Invalid, enter a positive number''.
- 5.Step 5: Prompt for a new input inside the loop: 'num <- USERINPUT'.
- 6.Step 6: End the loop and output a success message.
Question: A student wrote the following algorithm: x <- 5 y <- 2 WHILE x > y x <- x - 1 y <- y + 1 ENDWHILE Complete a trace table showing the values of x, y, and the condition (x > y) at each step.
- 1.Step 1: Set initial values: x = 5, y = 2.
- 2.Step 2: Evaluate condition (x > y): 5 > 2 is True.
- 3.Step 3: First iteration: x becomes 5 - 1 = 4; y becomes 2 + 1 = 3.
- 4.Step 4: Evaluate condition (x > y): 4 > 3 is True.
- 5.Step 5: Second iteration: x becomes 4 - 1 = 3; y becomes 3 + 1 = 4.
- 6.Step 6: Evaluate condition (x > y): 3 > 4 is False. Loop terminates.