← IGCSE Computer Science Paper 2

Converting pseudocode to a flowchart

Each pseudocode statement becomes one flowchart symbol: assignment is a process box, INPUT/OUTPUT a parallelogram, and IF or loop conditions a decision diamond.

Understanding Converting pseudocode to a flowchart in IGCSE Computer Science Paper 2

What it does: The condition after IF is written in a diamond. One exit is for Yes (true) and one for No (false). WHILE tests its condition first, so the diamond is drawn before the body and a No answer skips the body. An assignment is a calculation or storing step, so it goes in a process box. Parallelograms are only for INPUT and OUTPUT. A FOR loop is split into three parts: set the counter, test it against the limit, then update it at the end of each pass. A decision diamond has one flow line in and two out, for the two possible answers to the condition.

Common mistakes: An IF condition is a question, so it becomes a decision diamond, not a process box. It should read IF Mark > 50 : diamond. An assignment becomes a process box (a rectangle). Only conditions use a diamond. It should read Num ← Num + 1 : process.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 188–213) and word search (Modules 188–231).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which flowchart symbol do you draw for the pseudocode line: Total ← 0?
A parallelogramA process box (rectangle)
Matches
A rectangle drawn for OUTPUT Total
↓
OUTPUT must be drawn as a parallelogram, not a process box (rectangle).
Applying
Meanings
Term
Pseudocode to flowchart
Meaning
Each pseudocode statement becomes one flowchart symbol: assignment is a process box, INPUT/OUTPUT a parallelogram, and IF or loop conditions a decision diamond.
Practice
INPUT Mark // parallelogram
Testing
Gaps
Total ← 0 // box
Check Answer
Spots
2INPUT Mark : parallelogram
3IF Mark > 50 : process

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Dolphin' badge — Reef Streak, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which flowchart symbol do you draw for the pseudocode line: Total ← 0?
A. A parallelogram
B. A process box (rectangle) ✓
An assignment is a calculation or storing step, so it goes in a process box. Parallelograms are only for INPUT and OUTPUT.
2. Which symbol do you draw for the pseudocode line: INPUT Age?
A. A parallelogram ✓
B. A decision diamond
INPUT and OUTPUT both use a parallelogram. A diamond is only for a condition.
3. Which pseudocode statement becomes a decision diamond?
A. OUTPUT Mark
B. IF Mark >= 50 THEN ✓
The IF condition is a question with a Yes or No answer, so it becomes a diamond. OUTPUT is a parallelogram.
4. A flowchart has a diamond containing Count <= 5 and the flow goes back up to it from the loop body. Where was the diamond tested in the pseudocode?
A. Before the body, as in WHILE Count <= 5 DO ✓
B. After the body, as in REPEAT ... UNTIL Count > 5
A WHILE loop tests its condition first, so the diamond comes before the loop body. A REPEAT loop does the body first.
5. Where does the decision diamond go when you convert a REPEAT ... UNTIL loop?
A. After the loop body ✓
B. Before the loop body
REPEAT runs the body at least once and then tests the UNTIL condition, so the diamond comes after the body.

Match the Pairs

INPUT Age → Draw a parallelogram containing INPUT Age
Total ← Total + Mark → Draw a rectangular process box containing this assignment
An IF condition becomes a decision diamond with a Yes branch and a No branch → IF Score >= 50 THEN
In a WHILE loop the decision diamond comes before the loop body, so the body may never run → WHILE Count < 5 DO
A rectangle drawn for OUTPUT Total → OUTPUT must be drawn as a parallelogram, not a process box (rectangle).
REPEAT loop with the diamond drawn before the body → In a REPEAT ... UNTIL loop the diamond must come after the body, because the body always runs at least once.

Key Term

Pseudocode to flowchart
Each pseudocode statement becomes one flowchart symbol: assignment is a process box, INPUT/OUTPUT a parallelogram, and IF or loop conditions a decision diamond.

Fill in the Blanks

1. Total ← 0 // process box
Hint: Type the name of the flowchart box used for an assignment.
2. OUTPUT Total // parallelogram
Hint: Type the name of the flowchart shape used for INPUT and OUTPUT.
3. IF Score >= 50 THEN // diamond OUTPUT "Pass" ENDIF
Hint: Type the name of the flowchart shape used for an IF condition.
4. WHILE Count < 5 DO // test before body Count ← Count + 1 ENDWHILE
Hint: Type the loop keyword whose diamond is tested before the body runs.
5. FOR Count ← 1 TO 5 OUTPUT Count NEXT Count // flowchart: Count ← Count + 1
Hint: Type the number the counter goes up by in the flowchart's update step.

Spot the Error

Question 1
A Count ← 0 : process
B INPUT Mark : parallelogram
C IF Mark > 50 : process
D OUTPUT Count : parallelogram
Line C — An IF condition is a question, so it becomes a decision diamond, not a process box. It should read IF Mark > 50 : diamond.
Question 2
A Num ← 0 : process
B WHILE Num < 5 DO : diamond
C Num ← Num + 1 : diamond
D ENDWHILE : line to diamond
Line C — An assignment becomes a process box (a rectangle). Only conditions use a diamond. It should read Num ← Num + 1 : process.
Question 3
A REPEAT : loop start
B INPUT Pin : parallelogram
C UNTIL Pin = 1234 : process
Line C — The UNTIL condition is a test, so it becomes a decision diamond placed after the body. It should read UNTIL Pin = 1234 : diamond.
Question 4
A I ← 1 : process (set counter)
B I <= 3 ? : diamond (test)
C OUTPUT I : parallelogram
D I ← I + 1 : diamond (update)
Line D — A FOR loop's counter update is an assignment, so it is a process box. Only the test is a diamond. It should read I ← I + 1 : process (update).
Question 5
A INPUT Age : parallelogram
B IF Age >= 18 : diamond, 1 exit
C Yes path: OUTPUT Adult
D No path: OUTPUT Minor
Line B — A decision diamond always has two exits, labelled Yes and No. It should read IF Age >= 18 : diamond, Yes/No.

Student with a class code? Join your class →