Sign InCreate Account

EditorProjectsPseudocode TutorPractice QuestionsCode ConverterCode GeneratorFlowchartsUpgrade

Master Pseudocode with Pro

Get unlimited access to the AI Tutor, Code Generator, and Converters. Plus, enjoy an ad-free experience.

Upgrade Now

The Complete AQA Pseudocode Guide (8520)

If you are studying for the AQA GCSE Computer Science (8520) examination, understanding how AQA formats its algorithms is critical. AQA uses a very consistent, specific style of pseudocode across all of its assessment materials.

While you are technically free to use any recognizable pseudocode in your own written answers, memorizing the exact AQA syntax ensures you will never be confused when reading and tracing complex algorithmic questions in the exam hall.

This comprehensive guide breaks down the entire AQA pseudocode specification. We will cover variables, operators, selection, iteration, arrays, subroutines, string handling, and data conversion, complete with code examples.

Table of Contents

General Syntax RulesVariables and ConstantsInput, Output, and CommentsOperators (Arithmetic, Relational, Logical)Selection (IF Statements)Iteration (Loops)Arrays (1D and 2D)SubroutinesString HandlingString and Character ConversionRandom Number GenerationConclusion

General Syntax Rules

Before looking at specific constructs, there are a few general foundational rules AQA applies to all its pseudocode scripts:

  • Keywords are capitalized: Control words like IF, WHILE, OUTPUT, and SUBROUTINE are always written in uppercase bold in exam papers.
  • 0-Based Indexing: Exam questions will assume that indexing for arrays and strings starts at 0 unless specifically stated otherwise. The first item is always item 0.
  • Implicit Data Types: You do not need to explicitly declare variables or define types (like INTEGER or STRING) before using them. The type is implied automatically by the data you put in it.

Variables and Constants

AQA uses the left arrow exclusively for assignment. This is an incredibly important feature because it prevents any visual confusion with the equals sign =, which is used only for equality comparison. To define a constant (a value that cannot change), use the lowercase constant keyword.

Loading...

Input, Output, and Comments

AQA uses specific uppercase keywords to handle interactions with the user. The USERINPUT keyword pauses execution to grab data from the keyboard, and OUTPUT pushes text or variables to the screen. For developer comments, use the hash symbol #.

Loading...

Operators (Arithmetic, Relational, Logical)

AQA supports standard operators, but you must pay close attention to integer division, modulus, and how equality and inequality are represented.

Arithmetic Operators

Standard math operates using brackets for precedence alongside +, -, *, and /. AQA relies on two explicit keywords for division variants:

  • Integer Division: Uses the DIV keyword. Discards remainders. Example: 9 DIV 5 evaluates to 1. 8 DIV 4 evaluates to 2.
  • Modulus: Uses the MOD keyword. Returns only the remainder. Example: 9 MOD 5 evaluates to 4. 5 MOD 2 evaluates to 1.

Relational (Comparison) Operators

  • Equality: A single equals sign = (e.g., 3 = 3 evaluates to True).
  • Not Equal: The official symbol is . However, in an exam setting writing != is perfectly acceptable.
  • Magnitude: Standard math signs <, >, <=, >=.

Boolean (Logical) Operations

  • Logical AND: (3=3) AND (3<=4)
  • Logical OR: (x<1) OR (x>9)
  • Logical NOT: NOT (another_go = False)

Selection (IF Statements)

AQA utilizes standard IF, THEN, ELSE, and ELSE IF blocks to handle branching logic. Notice that the AQA spec does not feature a CASE or SWITCH statement; you must simply chain multiple ELSE IF lines for complex selections.

Loading...

Iteration (Loops)

AQA supports three types of loops: FOR (count-controlled), WHILE (pre-condition), and REPEAT UNTIL (post-condition). Note how REPEAT UNTIL loops until the condition becomes True, whereas WHILE loops while the condition remains True.

Loading...

Arrays (1D and 2D)

AQA expects 0-based indexing and square brackets [] to access elements. Arrays are easily initialized by assigning a comma-separated list surrounded by brackets. The LEN() function returns the total number of items.

Loading...

Subroutines

AQA does not separate functions and procedures by name. It strictly uses the universal SUBROUTINE block. If the block contains a RETURN statement, it operates as a function giving back a value.

Loading...

String Handling

AQA provides specific built-in methods for manipulating strings. Crucially, remember that string indexing starts at 0, just like arrays.

  • Length: LEN(StringExp) returns the full count including spaces.
  • Position: POSITION(StringExp, CharExp) returns the index of the first occurrence of a character. Example: POSITION('computer', 'm') evaluates to 2.
  • Substring: SUBSTRING(start, end, string). Note carefully: the second parameter is the final position, not the length! Example: SUBSTRING(2, 9, 'computer science') extracts characters from index 2 to index 9, yielding 'mputer s'.
  • Concatenation: Using the + symbol joins strings together. Example: 'computer' + 'science' evaluates to 'computerscience'.

String and Character Conversion

AQA requires explicit, capitalized function calls to cast variables from one type to another, including evaluating raw ASCII/Unicode values.

Loading...

Random Number Generation

To generate a random integer, use the RANDOM_INT(min, max) function, passing the inclusive minimum and maximum integer values.

Loading...

Conclusion

The AQA pseudocode specification (8520) is designed to be as clear and unambiguous as possible. It strictly separates assignment () from equality (=), enforces 0-based indexing for both strings and arrays, and utilizes highly descriptive, capitalized keywords for actions like SUBSTRING and RANDOM_INT.

While you might write your own pseudocode however you please during coursework, familiarizing yourself with this exact syntax ensures you will never be caught off guard by a trace table, algorithm, or fill-in-the-blanks question during your final examination. Practice these constructs regularly in our editor to commit them to memory!

Read Our Guide on
What is Pseudocode


Ready to practice? Try our editor.

Give our pseudocode editor a go today for free - with a built-in compiler, tools to convert pseudocode to code, and project saving, PseudoEditor makes writing pseudocode easier than ever!

Start coding now

Product

For SchoolsOverviewFeaturesFAQ

© 2026 PseudoEditor. All rights reserved.