← IGCSE Computer Science Paper 2

The coding stage

The third PDLC stage, where the design (pseudocode or flowchart) is turned into program code in a programming language, written step by step and checked against the requirements.

Understanding The coding stage in IGCSE Computer Science Paper 2

What it does: The programmer follows the pseudocode from the design stage and translates each step into the programming language. During coding the programmer checks that the code meets each requirement. Here the IF statement matches the requirement to reject marks over 100. You must design the solution before you write the code. The order is analysis, design, coding, then testing. The requirements list what the program must do. Comparing the code with them shows whether anything is missing or wrong. Writing code in small parts, step by step, makes errors easier to find and fix. It is a key idea of the coding stage.

Common mistakes: The design says the program must read two marks from the user. OUTPUT displays a value instead of reading one. The line should be INPUT Mark1. The requirement says to find the average. An average is the total divided by the number of marks, so the code should use / 3 and not * 3.

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 1–16) and word search (Modules 1–26).

Take this worksheet further — free with Cloodit

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

Learning
Duo
What happens in the coding stage of the PDLC?
The design is turned into program code in a programming languageThe problem is first identified and the requirements are listed
Matches
Start writing code before the design is finished and ignore the flowchart
↓
The coding stage should follow the design. Ignoring the pseudocode or flowchart means the code may not match the plan.
Applying
Meanings
Term
Coding stage
Meaning
The third PDLC stage, where the design (pseudocode or flowchart) is turned into program code in a programming language, written step by step and checked against the requirements.
Practice
// Design step 1: get the mark
Testing
Gaps
// Stage 3 of the PDLC:
Check Answer
Spots
1// Design: read two marks
2OUTPUT Mark1

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. What happens in the coding stage of the PDLC?
A. The problem is first identified and the requirements are listed
B. The design is turned into program code in a programming language ✓
Coding is the third stage. The analysis stage finds the problem and requirements, and the design stage plans the solution. Coding then turns that plan into real code.
2. Which is the guide a programmer follows during the coding stage?
A. The design, such as pseudocode or a flowchart ✓
B. The final test results
The design is the plan. The programmer follows it step by step. Test results only exist after the code has been written and run.
3. Which describes the correct order of the first three PDLC stages?
A. Analysis, design, coding ✓
B. Analysis, coding, design
You must design the solution before you write the code. The order is analysis, design, coding, then testing.
4. A programmer writes a very long program in one go and only runs it at the very end. Is this good practice in the coding stage?
A. Yes, it saves time because you only need to test once
B. No, code should be written in small parts and checked as you go ✓
Writing code in small parts makes errors easier to find and fix. This links to iterative testing while coding.
5. The design has the pseudocode line: INPUT Age. What should the programmer do in the coding stage?
A. Write the matching line of code in the chosen programming language ✓
B. Change the design so it asks for a different value
The programmer follows the design. Each pseudocode step becomes code that does the same job.

Match the Pairs

Coding stage → The third PDLC stage, where the design is turned into program code in a programming language
Build one sub-program at a time, then run it → Code is written in small parts so each part can be checked before the next is added
The design is the guide: each pseudocode line becomes a line of program code → OUTPUT "Enter a mark" becomes print("Enter a mark")
Code is compared against the requirements to check it does what the user needs → Requirement: reject marks over 100 -> IF Mark > 100 THEN
Start writing code before the design is finished and ignore the flowchart → The coding stage should follow the design. Ignoring the pseudocode or flowchart means the code may not match the plan.
Write the whole program in one go and only check it at the end → Code should be written in small parts and checked as you go. Leaving all checking to the end makes errors hard to find.

Key Term

Coding stage
The third PDLC stage, where the design (pseudocode or flowchart) is turned into program code in a programming language, written step by step and checked against the requirements.

Fill in the Blanks

1. // Stage 3 of the PDLC: Coding
Hint: Type the name of the stage where the design is turned into program code.
2. // Design: get the age from the user INPUT Age
Hint: Type the command that matches the design step of getting a value from the user.
3. // Design: add 1 to the count Count ← Count + 1
Hint: Type the variable name that is being increased, so the code follows the design.
4. // Requirement: mark is 0 to 100 IF Mark >= 0 AND Mark <= 100 THEN
Hint: Type the relational operator that checks the code against the requirement.
5. // Design: repeat 5 times FOR Count ← 1 TO 5 NEXT Count
Hint: Type the keyword that sets the end value of the loop that the design asks for.

Spot the Error

Question 1
A // Design: read two marks
B OUTPUT Mark1
C INPUT Mark2
D Total ← Mark1 + Mark2
Line B — The design says the program must read two marks from the user. OUTPUT displays a value instead of reading one. The line should be INPUT Mark1.
Question 2
A // Requirement: find the average
B Total ← Mark1 + Mark2 + Mark3
C Average ← Total * 3
D OUTPUT Average
Line C — The requirement says to find the average. An average is the total divided by the number of marks, so the code should use / 3 and not * 3.
Question 3
A // Design: loop 5 times
B FOR Count ← 1 TO 5
C OUTPUT "Hello"
D ENDFOR
Line D — A Cambridge pseudocode FOR loop is closed with NEXT and the loop variable, not ENDFOR. The line should be NEXT Count.
Question 4
A // Design: pass mark is 50
B IF Score >= 50 THEN
C OUTPUT "Pass"
D OTHERWISE
E OUTPUT "Fail"
F ENDIF
Line D — The flowchart's 'No' branch must be written with the keyword ELSE. OTHERWISE is not a Cambridge pseudocode keyword.
Question 5
A // Part 1: get the radius
B Radius ← INPUT
C // Part 2: find the area
D Area ← 3.14 * Radius ^ 2
Line B — INPUT is a command that is followed by the variable name. It is not a value that can be assigned. Part 1 should be INPUT Radius, and it can be tested before Part 2 is written.

Student with a class code? Join your class →