← IGCSE Computer Science Paper 1

Program and source code

The instructions a programmer writes in a programming language. The CPU cannot run it until a translator turns it into machine code.

Understanding Program and source code in IGCSE Computer Science Paper 1

What it does: Each line is one instruction and they run in order: first the input is taken, then the greeting is printed. Python's rules require the keyword if, a condition, a colon and an indented line. Following these rules gives valid source code. Source code is written by people. The CPU runs machine code, which is made by translating the source code. A program is an ordered list of instructions, and the order matters for sequence and for getting the right result. The instructions a programmer writes in a programming language. The CPU cannot run it until a translator turns it into machine code.

Common mistakes: Every programming language has rules for how source code is written. This line is missing the closing bracket. It should be print(name, total). The language only knows the instruction print. A misspelt keyword breaks the rules of the language, so the translator cannot understand the line. It should be print(x + y).

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 419–429) and word search (Modules 419–439).

Take this worksheet further — free with Cloodit

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

Learning
Duo
What is source code?
The instructions a programmer writes in a programming languageThe 1s and 0s that the CPU runs directly
Matches
The CPU can run source code directly without any translation
↓
The CPU only runs machine code. Source code must first be translated by a compiler, an interpreter or an assembler.
Applying
Meanings
Term
source code
Meaning
The instructions a programmer writes in a programming language. The CPU cannot run it until a translator turns it into machine code.
Practice
// Source code: a list of instructions
Testing
Gaps
# This is human-written code
Check Answer
Spots
3total = age + 1
4print(name, total

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. What is source code?
A. The 1s and 0s that the CPU runs directly
B. The instructions a programmer writes in a programming language ✓
Source code is written by people. The CPU runs machine code, which is made by translating the source code.
2. A program is a list of instructions. Which statement is correct?
A. The computer follows the instructions in order, one after another ✓
B. The computer picks the instructions in a random order
A program is an ordered list of instructions, and the order matters for sequence and for getting the right result.
3. Who normally writes source code?
A. A programmer ✓
B. The CPU
Programmers write source code in a language they can read. The CPU only runs machine code.
4. Can the CPU run source code written in Python directly?
A. No, it must be translated into machine code first ✓
B. Yes, the CPU understands Python directly
A translator (compiler or interpreter) is needed to turn source code into machine code that the CPU can run.
5. Which one is source code?
A. 10110001 00000101
B. total = price * quantity ✓
The first line is a high-level instruction people can read. The binary is machine code, which is what the CPU runs.

Match the Pairs

print("Hello") → A line of source code written by a programmer in a high-level language (Python); it is one instruction in a program
10110000 01100001 → Machine code that the CPU can run directly; it is what source code becomes after translation
A program is a list of instructions that the computer follows in order, one after another → name = input("Name? ") print("Hi " + name)
A programming language has rules (syntax) that programmers must follow when they write source code → if score >= 50: print("Pass")
The CPU can run source code directly without any translation → The CPU only runs machine code. Source code must first be translated by a compiler, an interpreter or an assembler.
prnit("Hello") → The command is spelled wrongly, which breaks the language's rules. It should be print("Hello"), or the translator will report an error.

Key Term

source code
The instructions a programmer writes in a programming language. The CPU cannot run it until a translator turns it into machine code.

Fill in the Blanks

1. # This is human-written source code print("Hi")
Hint: Type the word for the instructions a programmer writes in a language.
2. name = "Sam" print(name)
Hint: Type the function name that shows a value on the screen.
3. x = 5 y = x + 2 print(y)
Hint: Type the variable that holds the result of the second instruction.
4. # The CPU needs a translator to run this print("Hi")
Hint: Type the kind of software that turns source code into machine code.
5. # Python's rules are its syntax print("Hi")
Hint: Type the word for the rules of how code must be written in a language.

Spot the Error

Question 1
A name = input("Name: ")
B age = 15
C total = age + 1
D print(name, total
Line D — Every programming language has rules for how source code is written. This line is missing the closing bracket. It should be print(name, total).
Question 2
A x = 5
B y = 10
C prnt(x + y)
Line C — The language only knows the instruction print. A misspelt keyword breaks the rules of the language, so the translator cannot understand the line. It should be print(x + y).
Question 3
A total = 0
B total = totl + 5
C print(total)
Line B — The variable name is misspelt, so the instruction refers to something that does not exist. It should be total = total + 5.
Question 4
A score = 10
B bonus = 5
C score = score + bonus
D print score
Line D — In Python, print is a function, so its input must be in brackets. Source code must follow the language's rules. It should be print(score).
Question 5
A name = "Sam"
B age = 15
C Print(name, age)
Line C — Python is case-sensitive, so Print is not the same instruction as print. The translator does not recognise it. It should be print(name, age).

Student with a class code? Join your class →