← IGCSE Computer Science Paper 2

Describing the processes in an algorithm

State, in order and in plain words, what each part of the algorithm does with the data: set up variables, what the loop repeats, what the decision does, then the output.

Understanding Describing the processes in an algorithm in IGCSE Computer Science Paper 2

What it does: The description names how many times the loop runs and what happens to the data on each repeat: input, then add. Initialising sets a starting value. The arrow ← assigns a value. It does not compare. Always say what the variable is set to and why. Processes must be described in the order the algorithm carries them out, from the start to the end. Describe exactly what is output and what it means. The total divided by 10 gives the average, so say so. Say what makes the loop continue or stop in plain words. Naming the loop type does not describe what it does.

Common mistakes: The loop should add each mark to the running total. Total ← Mark overwrites the total each time. It should be Total ← Total + Mark. Count starts at 0, so Count > 5 is false straight away and the loop never repeats. The loop should repeat while Count < 5.

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 216–231) 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 is a better description of the process in the line Total ← 0 at the start of an algorithm?
Sets the variable Total to zero before the loop startsChecks if Total is equal to zero
Matches
The program loops and does stuff with the numbers, then it finishes.
↓
Too vague: it does not say what is repeated or what happens to the data, so it gains no marks.
Applying
Meanings
Term
Describe the processes
Meaning
State, in order and in plain words, what each part of the algorithm does with the data: set up variables, what the loop repeats, what the decision does, then the output.
Practice
// Set the counter to zero
Testing
Gaps
Total ←
Check Answer
Spots
3 INPUT Mark
4 Total ← Mark

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

The 'Fox' badge — Cunning Debugger, 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 is a better description of the process in the line Total ← 0 at the start of an algorithm?
A. Checks if Total is equal to zero
B. Sets the variable Total to zero before the loop starts ✓
Initialising sets a starting value. The arrow ← assigns a value. It does not compare. Always say what the variable is set to and why.
2. A loop runs FOR Count ← 1 TO 5 and each time adds a number to Total. Which describes what the loop repeats?
A. It repeats 5 times, adding each input number to Total ✓
B. It loops and does the calculation
A good description says how often the loop runs and what happens to the data each time. 'Does the calculation' is too vague to earn a mark.
3. Which sentence correctly describes a decision: IF Mark >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF?
A. It checks the mark and outputs a message
B. If Mark is 50 or more it outputs Pass, otherwise it outputs Fail ✓
Describe the condition and BOTH outcomes. Saying 'checks the mark' does not say what happens in each case.
4. In what order should you describe the processes of an algorithm?
A. In the order they happen: set up variables, loop, decision, then output ✓
B. Start with the output, then go back to the variables
Processes must be described in the order the algorithm carries them out, from the start to the end.
5. Which description of Total ← Total + Number inside a loop is better?
A. Adds the number just entered to the running total ✓
B. Makes Total equal to Total plus Number
The wrong answer just reads the code aloud. A good description explains what it does with the data: it adds each number to a running total.

Match the Pairs

Total ← 0 → Initialising: the variable Total is set to zero before the loop so it can start adding up values.
OUTPUT Total → Final output: after the loop has finished, the value stored in Total is displayed to the user.
Describe what the loop repeats: for each of the 10 numbers, the next value is input and added to the total. → FOR Count ← 1 TO 10 INPUT Num Total ← Total + Num NEXT Count
Describe the decision and its outcomes: if the mark is 50 or more, Pass is output, otherwise Fail is output. → IF Mark >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF
The program loops and does stuff with the numbers, then it finishes. → Too vague: it does not say what is repeated or what happens to the data, so it gains no marks.
Total ← Total + Num is the process, so the answer just copies the code line. → Copying code is not a description. The answer must explain in words what the line does with the data.

Key Term

Describe the processes
State, in order and in plain words, what each part of the algorithm does with the data: set up variables, what the loop repeats, what the decision does, then the output.

Fill in the Blanks

1. Total ← 0 Count ← 0 FOR Index ← 1 TO 10
Hint: Type the starting value given to the total before the loop begins, so the running total starts clean.
2. FOR Index ← 1 TO 10 Total ← Total + Mark[Index] NEXT Index
Hint: Type the keyword that begins the loop whose repeated step adds each mark to the total.
3. IF Mark[Index] > Highest THEN Highest ← Mark[Index] ENDIF
Hint: Type the keyword that comes after the decision's condition and introduces what happens when it is true.
4. Average ← Total / 10 OUTPUT Average
Hint: Type the keyword that shows the final result to the user at the end of the algorithm.
5. WHILE Count < 5 DO Count ← Count + 1 ENDWHILE
Hint: Type the arithmetic operator that makes the counter go up by one each time the loop repeats.

Spot the Error

Question 1
A Total ← 0
B FOR Count ← 1 TO 5
C INPUT Mark
D Total ← Mark
E NEXT Count
F OUTPUT Total
Line D — The loop should add each mark to the running total. Total ← Mark overwrites the total each time. It should be Total ← Total + Mark.
Question 2
A Count ← 0
B WHILE Count > 5 DO
C OUTPUT Count
D Count ← Count + 1
E ENDWHILE
Line B — Count starts at 0, so Count > 5 is false straight away and the loop never repeats. The loop should repeat while Count < 5.
Question 3
A Total ← 0
B // Repeat 5 times
C FOR N ← 1 TO 4
D Total ← Total + N
E NEXT N
Line B — The comment describes the loop wrongly. FOR N ← 1 TO 4 repeats 4 times, so the comment should say Repeat 4 times.
Question 4
A Total ← 1
B FOR N ← 1 TO 5
C Total ← Total + N
D NEXT N
E OUTPUT Total
Line A — The variable must be set up to 0 before the loop so that only the numbers are added. Starting at 1 makes the final total too big. It should be Total ← 0.
Question 5
A INPUT Age
B IF Age >= 18 THEN
C OUTPUT "Child"
D ELSE
E OUTPUT "Child"
F ENDIF
Line C — The THEN branch runs when Age >= 18, so it must output Adult. Outputting Child here gives the wrong outcome for the decision. It should be OUTPUT "Adult".

Student with a class code? Join your class →