← IGCSE Computer Science Paper 2

Pseudocode assignment: ←

The ← symbol is assignment: it stores the value on its right in the variable on its left. Total ← 0 sets Total to 0. Total ← Total + Score adds Score to Total.

Understanding Pseudocode assignment: ← in IGCSE Computer Science Paper 2

What it does: Count is on the left, so it is the variable being changed. The value 10 on the right is stored in it. Using Total on both sides adds Score to what Total already holds and saves the new answer in Total. Total + Score is 10 + 5 = 15, and this value is stored back in Total. In pseudocode, ← is assignment. It does not test whether two values are equal.

Common mistakes: The variable must be on the left of ← and the value on the right. 0 is not a variable, so it cannot store anything. It should be Total ← 0. The left side of ← must be a single variable. Total + 5 is a calculation, so it goes on the right. It should be Total ← Total + 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 123–134) and word search (Modules 123–145).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which line correctly sets the variable Total to 0 in Cambridge pseudocode?
0 ← TotalTotal ← 0
Matches
0 ← Total
↓
The value and variable are the wrong way round. The variable must be on the left and the value on the right, so it should be Total ← 0.
Applying
Meanings
Term
Total ← 0
Meaning
The ← symbol is assignment: it stores the value on its right in the variable on its left. Total ← 0 sets Total to 0. Total ← Total + Score adds Score to Total.
Practice
Total ← 0
Testing
Gaps
Total 0
Check Answer
Spots
1INPUT Score
20 ← Total

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

The 'Ostrich' badge — Full Sprint, 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 line correctly sets the variable Total to 0 in Cambridge pseudocode?
A. 0 ← Total
B. Total ← 0 ✓
The variable goes on the left of the ← and the value goes on the right, so Total ← 0 stores 0 in Total.
2. In Total ← 0, which side of the ← symbol holds the variable that receives the value?
A. The left side ✓
B. The right side
The ← points to the variable on the left. The value on the right is stored in it.
3. What does Total ← Total + Score do?
A. Adds Score to the current value of Total and stores the result in Total ✓
B. Checks whether Total is equal to Total + Score
← is assignment, not a comparison. The right side is worked out first, then the result is stored in the variable on the left.
4. Total is 10 and Score is 5. What is Total after Total ← Total + Score?
A. 15 ✓
B. 5
Total + Score is 10 + 5 = 15, and this value is stored back in Total.
5. Which of these is an assignment that stores the value 7 in Score?
A. Score → 7
B. Score ← 7 ✓
Assignment uses the arrow pointing left (← typed as <-), towards the variable that receives the value.

Match the Pairs

Total ← 0 → Stores the value 0 in the variable Total, so Total starts at zero
Total ← Total + Score → Works out the current Total plus Score, then stores the answer back in Total
The variable that receives the value goes on the left of the ← symbol → Count ← 10
To keep a running total, assign the old total plus the new value back to the total → Total ← Total + Score
0 ← Total → The value and variable are the wrong way round. The variable must be on the left and the value on the right, so it should be Total ← 0.
Total + Score ← Total → The calculation is on the left. The variable must be on the left and the calculation on the right, so it should be Total ← Total + Score.

Key Term

Total ← 0
The ← symbol is assignment: it stores the value on its right in the variable on its left. Total ← 0 sets Total to 0. Total ← Total + Score adds Score to Total.

Fill in the Blanks

1. Total ← 0
Hint: Type the assignment symbol that stores the value on the right in the variable on the left.
2. Total ← 0 Score ← 8 Total ← Total + Score
Hint: Type the variable on the left that will store the new running total.
3. Total ← 0 Score ← 8 Total ← Total + Score
Hint: Type the operator that adds Score to the current value of Total.
4. Total ← 0 OUTPUT Total
Hint: Type the starting value on the right, so the running total starts empty.
5. Score ← 8 Total ← Total + Score
Hint: Type the variable on the right that holds the current running total before Score is added.

Spot the Error

Question 1
A INPUT Score
B 0 ← Total
C Total ← Total + Score
D OUTPUT Total
Line B — The variable must be on the left of ← and the value on the right. 0 is not a variable, so it cannot store anything. It should be Total ← 0.
Question 2
A Total ← 0
B Total + 5 ← Total
C OUTPUT Total
Line B — The left side of ← must be a single variable. Total + 5 is a calculation, so it goes on the right. It should be Total ← Total + 5.
Question 3
A Total ← 0
B INPUT Score
C Total ← Score
D OUTPUT Total
Line C — This replaces Total with Score instead of adding Score to the running total. It should be Total ← Total + Score.
Question 4
A Count ← 0
B INPUT Mark
C IF Mark >= 50 THEN
D Count ← Count - 1
E ENDIF
Line D — Counting passes needs Count to go up by 1, but this subtracts 1. The line should be Count ← Count + 1.
Question 5
A INPUT Price
B INPUT Qty
C Cost Price * Qty
D OUTPUT Cost
Line C — The assignment arrow is missing, so nothing is stored in Cost. It should be Cost ← Price * Qty.

Student with a class code? Join your class →