← IGCSE Computer Science Paper 2

Writing an algorithm as a flowchart from a problem

A diagram that solves a problem using symbols for start, input, process, decision, output and stop, joined by arrows. Label each decision Yes or No and test every path to Stop.

Understanding Writing an algorithm as a flowchart from a problem in IGCSE Computer Science Paper 2

What it does: Both exits of the decision lead to an output and then to Stop, so no path is left dangling. Using test data on the boundary value shows that both paths work and that the condition is correct. A check that has two outcomes needs a decision diamond. Each exit must be labelled Yes or No. Input and output use the parallelogram. The rectangle is for processes such as Total ← Total + Mark. A flowchart has one Start. It can have more than one path, but every path must end at a Stop. A repeated input needs an arrow that goes back to the input symbol. Only the valid Yes path continues on to Stop.

Common mistakes: OUTPUT must be drawn in a parallelogram (shown here as / /), not a process rectangle [ ]. It should be Yes -> /OUTPUT "Pass"/. Every arrow leaving a decision must be labelled Yes or No. The line should start Yes -> so the path is clear.

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 254–264) and word search (Modules 254–274).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A problem says: 'Ask for a password and check it is correct.' Which symbol should the check use?
A decision diamond with a Yes branch and a No branchA process rectangle with one arrow out
Matches
Diamond with one Yes exit and no No exit
↓
The decision has only one labelled exit, so the No path is missing and the flowchart cannot finish for some data
Applying
Meanings
Term
flowchart
Meaning
A diagram that solves a problem using symbols for start, input, process, decision, output and stop, joined by arrows. Label each decision Yes or No and test every path to Stop.
Practice
// Start
Testing
Gaps
Parallelogram: Mark
Check Answer
Spots
3<Mark >= 50?>
4Yes -> [OUTPUT "Pass"]

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

The 'Leopard' badge — Savannah Perfectionist, 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. A problem says: 'Ask for a password and check it is correct.' Which symbol should the check use?
A. A process rectangle with one arrow out
B. A decision diamond with a Yes branch and a No branch ✓
A check that has two outcomes needs a decision diamond. Each exit must be labelled Yes or No.
2. Which flowchart symbol should show 'INPUT Mark'?
A. Parallelogram (input/output) ✓
B. Rectangle (process)
Input and output use the parallelogram. The rectangle is for processes such as Total ← Total + Mark.
3. Which shows a correct decision for the problem 'Is the temperature over 30?'
A. Diamond containing Temp > 30, with arrows labelled Yes and No ✓
B. Diamond containing Temp > 30, with two unlabelled arrows
Every exit from a decision must be labelled Yes or No, otherwise the reader cannot follow the paths.
4. When you build a flowchart from a problem, how many Start symbols does it need?
A. One Start for each decision
B. One Start terminator at the top ✓
A flowchart has one Start. It can have more than one path, but every path must end at a Stop.
5. A flowchart has a decision with a Yes path that reaches Stop, but the No path just ends in mid-air. What is wrong?
A. The No path does not reach Stop, so the flowchart is incomplete ✓
B. Nothing, because only the Yes path needs to reach Stop
Every path through the flowchart must lead to a Stop terminator. Test each path with test data to check this.

Match the Pairs

Diamond labelled Yes / No: Is Mark >= 50? → A decision symbol with two labelled exits, so the flowchart can follow either path depending on the data
Parallelogram: INPUT Mark → An input symbol that reads a value from the user into the variable Mark
Every path through the flowchart must reach a Stop symbol → Yes branch: OUTPUT "Pass" → Stop; No branch: OUTPUT "Fail" → Stop
Check the flowchart with test data such as 50 and 49 to follow each path → Test Mark = 50 → Yes → Pass; Test Mark = 49 → No → Fail
Diamond with one Yes exit and no No exit → The decision has only one labelled exit, so the No path is missing and the flowchart cannot finish for some data
Rectangle: INPUT Mark → Input drawn in a process rectangle instead of a parallelogram

Key Term

flowchart
A diagram that solves a problem using symbols for start, input, process, decision, output and stop, joined by arrows. Label each decision Yes or No and test every path to Stop.

Fill in the Blanks

1. Parallelogram: INPUT Mark Diamond: Mark >= 50?
Hint: Type the keyword written inside the symbol that reads a value from the user.
2. Diamond: Mark >= 50? Yes arrow: OUTPUT "Pass" No arrow: OUTPUT "Fail"
Hint: Type the label for the arrow taken when the condition is true.
3. OUTPUT "Pass" -> Stop OUTPUT "Fail" -> Stop
Hint: Type the terminator label that every path must finally reach.
4. Rectangle: Total ← Total + Mark
Hint: Type the assignment symbol used in a process box.
5. Test data: Mark = 50, expect Pass Diamond: Mark >= 50? Yes -> OUTPUT "Pass" -> Stop
Hint: Type the relational operator so the boundary mark of 50 follows the Yes path.

Spot the Error

Question 1
A (START)
B /INPUT Mark/
C <Mark >= 50?>
D Yes -> [OUTPUT "Pass"]
E No -> /OUTPUT "Fail"/
F (STOP)
Line D — OUTPUT must be drawn in a parallelogram (shown here as / /), not a process rectangle [ ]. It should be Yes -> /OUTPUT "Pass"/.
Question 2
A (START)
B /INPUT Temp/
C <Temp > 30?>
D -> /OUTPUT "Hot"/
E No -> /OUTPUT "OK"/
F (STOP)
Line D — Every arrow leaving a decision must be labelled Yes or No. The line should start Yes -> so the path is clear.
Question 3
A (START)
B /INPUT Price/
C [Total ← Price * Qty]
D /OUTPUT Total/
E (STOP)
Line B — Qty is used in the process but never input, so Total cannot be worked out. The input should be /INPUT Price, Qty/.
Question 4
A (START)
B [Total = 0]
C /INPUT Mark/
D [Total ← Total + Mark]
E /OUTPUT Total/
F (STOP)
Line B — A process symbol sets a value using the assignment arrow ←, not =. It should be [Total ← 0].
Question 5
A [START]
B /INPUT Num/
C [Square ← Num * Num]
D /OUTPUT Square/
E (STOP)
Line A — START must be drawn in a terminator (rounded) symbol, not a process rectangle. It should be (START).

Student with a class code? Join your class →