Designing and Refining Algorithms
Aligned to the OCR J277 specification
- Topic
- Algorithms
- Level
- Intermediate
- Reading time
- 8 min
- Published
- 11 June 2026
- Updated
- 1 July 2026
On this page
Key takeaways
- Pseudocode is a language-independent way to write algorithms precisely enough to translate directly into code, using constructs like IF, FOR, and WHILE.
- A trace table records the value of every variable after each step, letting you verify an algorithm's output and pinpoint exactly where it goes wrong.
- A syntax error prevents a program from running; a logic error lets it run but produces incorrect output - the key test is whether the program executes at all.
- Flowchart decision diamonds must be diamond-shaped and have exactly two labelled exits (YES/NO); using a rectangle for a decision loses marks even if the logic is correct.
- In nested loops, the inner loop runs completely for each iteration of the outer loop, so track every variable separately in a trace table.
How much of this have you taken in?
Quiz yourself on this section, free, no card needed.
Key terms
- Algorithm
- A precise, finite, unambiguous sequence of steps that solves a problem and produces the correct output for all valid inputs.
- Pseudocode
- A structured, language-independent notation for writing algorithms, precise enough to translate into code but not tied to any specific programming language.
- Flowchart
- A diagram that uses standard symbols (terminal, process, decision, etc.) to show the sequence, decisions, and loops in an algorithm.
- Trace table
- A table that records the value of every variable after each step of an algorithm, used to verify correctness or find where it produces wrong output.
- Syntax error
- An error that breaks the grammatical rules of a programming language, preventing the program from being run or translated.
- Logic error
- An error where the program runs without crashing but produces incorrect or unexpected output due to a flaw in the algorithm's logic.
- Structure diagram
- A hierarchy of boxes showing how a problem is decomposed into sub-tasks, with lines connecting each sub-task to its parent.
- Nesting
- Placing one programming construct inside another, such as an IF inside another IF or a loop inside a loop.
- IPO model
- A planning framework that identifies an algorithm's Inputs, Processes, and Outputs before any code is written.
Frequently asked questions
A syntax error breaks the grammar rules of the language so the program cannot run at all. A logic error lets the program run but produces incorrect or unexpected output, such as using the wrong comparison operator at a boundary value.
OCR J277 requires six symbols: a rounded rectangle (terminal) for Start/End, a rectangle (process) for actions, a parallelogram for input/output, a diamond (decision) for yes/no branches, a rectangle with double bars for sub-programs, and arrows for flow direction.
Record every variable's value at the exact moment each line executes, not at the end of a loop. Track each variable - including inner and outer loop counters - in its own column and update it row by row as the algorithm runs.
Generate revision on any topic you study
Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set, personalised to your level.
Lessons on anything
Structured, level-matched lessons on any topic you study
Practice quizzes
Find out what you actually know before the exam does
Flashcard sets
Lock in key concepts with instant revision cards
Ask Aica
Stuck on something? Get a clear explanation, any time
Computational Thinking
Searching Algorithms
Related lessons
8 min
7 min
9 min
8 min