Pseudocode & Flowcharts

💻 Computer Science Years 6–9 Foundation

Planning algorithms with plain-English pseudocode and with standard flowchart shapes.

Open this lesson, with practice and a printable worksheet →

Two chefs, one recipe. One writes it in French, the other in English — yet both cook the same dish, because the steps are the same. When a programmer plans a solution they want that same freedom: to describe the steps clearly without getting tangled in the fussy grammar of Python or Java. Two tools give them exactly that: pseudocode (the plan written in plain, structured English) and flowcharts (the plan drawn as boxes and arrows).

Why this matters: A plan you can read is a plan you can check for mistakes before you write code. Pseudocode and flowcharts are board-agnostic, so an examiner in any language can follow them — and so can a teammate who has never met you.
START INPUT age age >= 18? No Yes Deny Allow
A flowchart: oval terminators, a rectangle for a process, a diamond for a decision.

The four flowchart shapes

START/STOPOval = terminatorINPUT / OUTPUTParallelogramprocessRectangle = dox > 5?Diamond = decide
The four building blocks every flowchart is made from.

Think of it like a board game: you follow the arrows one square at a time, and the diamond is the "roll again or move on?" junction.

Writing pseudocode

IF age >= 18 THENOUTPUT "allowed"ELSEOUTPUT "denied"ENDIFage>=18?allowed / deniedNoYes
The same choice, two ways: IF...ELSE in text, a diamond in a flowchart.

Many exam boards, including Cambridge IGCSE, use a standard set of pseudocode conventions — a good habit to learn even if you're not sitting that specific exam. Keywords are in CAPITALS, you indent inside a block, assignment uses a left arrow ←, and you declare each variable with a type. The core keywords: DECLARE name : TYPE (INTEGER, REAL, CHAR, STRING, BOOLEAN), INPUT, OUTPUT, IF … THEN … ELSE … ENDIF, CASE OF … OTHERWISE … ENDCASE, WHILE … DO … ENDWHILE, REPEAT … UNTIL and FOR … TO … NEXT. Arrays are 1-based: ARRAY[1:n].

DECLARE age : INTEGER
age ← INPUT("Enter your age")
IF age >= 18 THEN
    OUTPUT "Access allowed"
ELSE
    OUTPUT "Access denied"
ENDIF

Two views of one idea

PseudocodeFlowchart
FormStructured textShapes and arrows
Best forLong or detailed logicSeeing the overall flow at a glance
Decision shown asIF … ELSEA diamond with Yes/No
Worked reasoning: Trace the pseudocode above with age = 15.
15 >= 18?FalseNoYes"denied""allowed"
With age = 15 the test is False, so the No path runs.
The condition 15 >= 18 is False, so the ELSE branch runs and the program outputs "Access denied". With age = 20, the condition is True, so it outputs "Access allowed".
Common mistake: Using a rectangle for a decision. A yes/no question must be a diamond — and a diamond must always have two arrows leaving it, one for each answer. A rectangle only ever has one arrow out.

Memory hook: Ovals top and tail, Diamonds decide, Rectangles do the work — "Only Dogs Run".

Get the printable worksheet →
← Computational Thinking → Searching Algorithms
← Sasta Basta home All subjects