Skip to topic
    ← Back to course topics

    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

    1. Apply a systematic approach by identifying inputs, processing and outputs before designing an algorithm.
    2. Create a correct algorithm and represent it accurately in pseudo-code, program code and a flowchart.
    3. 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
    1. 1Day 1-3: Memorise and practice drawing all standard flowchart symbols and complete 5 flowchart-to-pseudocode translation drills.
    2. 2Day 4-6: Practice dry-running algorithms using past-paper trace tables involving count-controlled and condition-controlled loops.
    3. 3Day 7-10: Write pseudocode solutions for common problem patterns (linear search, finding maximum/minimum, running totals, validation).
    4. 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)
    Complete

    Fill in missing components in a diagram or table (e.g., trace table values or flowchart symbols) accurately using the provided data.

    Write

    Produce a coherent algorithm in pseudocode or program code that fully solves the problem specification and handles edge cases.

    Describe

    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)
    Pitfall: Confusing flowchart symbols, specifically using a rectangle for inputs/outputs instead of a parallelogram, or omitting decision branch labels ('Yes'/'No' or 'True'/'False').
    ❌ Weak Answer (Loses Marks):The student draws a standard rectangle with the text 'Enter age' and draws a diamond with lines coming out without indicating which path represents True or False.
    Example improved answer:The student uses a parallelogram for 'INPUT age' and a diamond for 'age >= 18' with clearly annotated outgoing lines labelled 'True' leading to one process and 'False' leading to another.
    Examiner Tip: Always use a ruler to draw neat flowchart shapes and double-check that every decision diamond has exactly two outgoing paths, each clearly labelled with its condition outcome.
    Pitfall: Failing to update variable values row-by-row in trace tables, or overwriting values on the same line when a variable changes in a new loop iteration.
    ❌ Weak Answer (Loses Marks):Writing all values taken by a variable across the entire program into a single cell separated by commas.
    Example improved answer:Creating a new row whenever any variable changes value or when a condition is evaluated, keeping the state of each variable clear at every step of execution.
    Examiner Tip: In trace table questions, only write in a column when that specific variable's value changes. Never bundle multiple loop iterations into a single row unless instructed.
    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. 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. 2.Step 2: Initialize the variable by taking the first input: 'num <- USERINPUT'.
    3. 3.Step 3: Define the condition to check if the number is invalid: 'num <= 0'.
    4. 4.Step 4: Inside the loop, output an error message: 'OUTPUT 'Invalid, enter a positive number''.
    5. 5.Step 5: Prompt for a new input inside the loop: 'num <- USERINPUT'.
    6. 6.Step 6: End the loop and output a success message.
    Final Answer: num <- USERINPUT WHILE num <= 0 OUTPUT 'Invalid number. Must be positive.' num <- USERINPUT ENDWHILE OUTPUT 'Valid number entered: ', num

    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. 1.Step 1: Set initial values: x = 5, y = 2.
    2. 2.Step 2: Evaluate condition (x > y): 5 > 2 is True.
    3. 3.Step 3: First iteration: x becomes 5 - 1 = 4; y becomes 2 + 1 = 3.
    4. 4.Step 4: Evaluate condition (x > y): 4 > 3 is True.
    5. 5.Step 5: Second iteration: x becomes 4 - 1 = 3; y becomes 3 + 1 = 4.
    6. 6.Step 6: Evaluate condition (x > y): 3 > 4 is False. Loop terminates.
    Final Answer: Initial state: x=5, y=2 | Iteration 1: condition=True, x=4, y=3 | Iteration 2: condition=True, x=3, y=4 | Check condition: False, loop terminates.
    Active Recall Memory Test
    What standard shape represents an Input/Output operation in an algorithm flowchart?
    Key Fact: A parallelogram.
    What is the primary purpose of a dry run using a trace table?
    Key Fact: To manually trace the execution of code or pseudocode line-by-line to verify logic and locate errors.
    What flowchart shape is used to represent an IF condition or loop decision?
    Key Fact: A diamond.
    What is the difference between a pre-condition loop and a post-condition loop?
    Key Fact: A pre-condition loop tests the condition before executing code (0 or more times); a post-condition loop tests after running code (at least once).
    Frequently Asked Questions
    Do I have to use exact Python syntax when writing pseudocode in AQA exams?
    No, AQA GCSE Computer Science does not require you to write valid Python syntax in pseudocode questions. As long as your logic is clear, unambiguous, and uses standard programming constructs like loops, selection, and assignment, you will receive full marks. However, using consistent pseudocode or Python syntax is highly recommended to avoid ambiguity.
    What is the difference between an algorithm and a program?
    An algorithm is a conceptual, step-by-step set of instructions designed to solve a problem regardless of hardware or programming language. A program is a concrete implementation of an algorithm written in a specific programming language (such as Python or C#) that can be translated and executed by a computer.
    Can I use flowcharts instead of pseudocode when an exam question says 'write an algorithm'?
    Unless the question explicitly specifies pseudocode or program code, AQA mark schemes generally accept accurate flowcharts to represent an algorithm. However, writing pseudocode is usually much faster and less prone to drawing errors, making it the preferred format for most students.
    Why do examiners penalise flowcharts without arrowheads?
    Flowcharts model the logical flow of execution. Without clear arrowheads, it is impossible to determine the sequence of steps, especially when loops branch backwards to repeat earlier instructions.
    How do I show an array or list access in pseudocode?
    In AQA pseudocode, arrays are indexed using square brackets, such as 'names[0]' or 'scores[i]'. Remember that in most GCSE contexts, indices start at 0 unless otherwise specified by the exam question.