Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028.
Syllabus overview
Assessment overview
All candidates take two components. Candidates will be eligible for grades A* to E.
All candidates take: and:
Paper 1 1 hour 45 minutes Paper 2 1 hour 45 minutes
Computer Systems 50% Algorithms, Programming and Logic 50%
75 marks 75 marks
Short-answer and structured questions Short-answer and structured questions and a
Questions will be based on Topics 1–6 of the scenario-based question
subject content Questions will be based on Topics 7–10 of the
All questions are compulsory subject content
No calculators are permitted All questions are compulsory
Externally assessed No calculators are permitted
Externally assessed
Information on availability is in the Before you start section.
Back to contents page www.cambridgeinternational.org/olevel 9
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Syllabus overview
Assessment objectives
The assessment objectives (AOs) are:
AO1
Demonstrate knowledge and understanding of the principles and concepts of computer science.
AO2
Apply knowledge and understanding of the principles and concepts of computer science to a given context,
including the analysis and design of computational or programming problems.
AO3
Provide solutions to problems by:
• evaluating computer systems
• making reasoned judgements
• presenting conclusions.
Weighting for assessment objectives
The approximate weightings allocated to each of the assessment objectives (AOs) are summarised below.
Assessment objectives as a percentage of the qualification
Assessment objective Weighting in O Level %
AO1 40
AO2 40
AO3 20
Total 100
Assessment objectives as a percentage of each component
Assessment objective Weighting in components %
Paper 1 Paper 2
AO1 60 20
AO2 20 60
AO3 20 20
Total 100 100
Back to contents page www.cambridgeinternational.org/olevel 10
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028.
3 Subject content
This syllabus gives you the flexibility to design a course that will interest, challenge and engage your learners.
Where appropriate you are responsible for selecting resources and examples to support your learners’
study. These should be appropriate for the learners’ age, cultural background and learning context as well as
complying with your school policies and local legal requirements.
Computer Science is a practical subject and a range of practical exercises must be integral to the teaching
of this qualification. It is important that learners develop their computational thinking skills by doing practical
problem-solving and programming using appropriate resources. It is also expected that learners have the
opportunity in class to write their own programs, as well as executing (running), testing and debugging them.
Any equipment and facilities should be adequate for learners to be able to satisfy the requirements of the
syllabus. The hardware facilities needed will depend on the number of learners but must be sufficient for all
learners to have enough time to practise their programming skills. Learners also need to have access to a
system with direct-access file capability on backing store and hardcopy facilities.
Computer systems
1 Data representation
1.1 Number systems
Candidates should be able to: Notes and guidance
1 Understand how and why computers use • Any form of data needs to be converted to
binary to represent all forms of data binary to be processed by a computer
• Data is processed using logic gates and stored
in registers
2 (a) Understand the denary, binary and • Denary is a base 10 system
hexadecimal number systems • Binary is a base 2 system
• Hexadecimal is a base 16 system
(b) Convert between • Values used will be integers only
(i) positive denary and positive binary • Conversions in both directions, e.g. denary to
(ii) positive denary and positive binary or binary to denary
hexadecimal • Maximum binary number length of 16-bit
(iii) positive hexadecimal and positive
binary
3 Understand how and why hexadecimal is used • Areas within computer science that
as a beneficial method of data representation hexadecimal is used should be identified
• Hexadecimal is easier for humans to
understand than binary, as it is a shorter
representation of binary
4 (a) Add two positive 8-bit binary integers
(b) Understand the concept of overflow and • An overflow error will occur if the value is
why it occurs in binary addition greater than 255 in an 8-bit register
• A computer or a device has a predefined limit
that it can represent or store, for example 16-bit
• An overflow error occurs when a value outside
this limit should be returned
Back to contents page www.cambridgeinternational.org/olevel 11
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
1.1 Number systems continued
Candidates should be able to: Notes and guidance
5 Perform a logical binary shift on a positive 8-bit • Perform logical left shifts
binary integer and understand the effect this • Perform logical right shifts
has on the positive binary integer
• Perform multiple shifts
• Bits shifted from the end of the register are lost
and zeros are shifted in at the opposite end of
the register
• The positive binary integer is multiplied or
divided according to the shift performed
• The most significant bit(s) or least significant
bit(s) are lost
6 Use the two’s complement number system to • Convert a positive binary or denary integer to a
represent positive and negative 8-bit binary two’s complement 8-bit integer and vice versa
integers • Convert a negative binary or denary integer to a
two’s complement 8-bit integer and vice versa
1.2 Text, sound and images
Candidates should be able to: Notes and guidance
1 Understand how and why a computer • Text is converted to binary to be processed by
represents text and the use of character a computer
sets, including American standard code for • Unicode allows for a greater range of
information interchange (ASCII) and Unicode characters and symbols than ASCII, including
different languages and emojis
• Unicode requires more bits per character than
ASCII
2 Understand how and why a computer • A sound wave is sampled for sound to be
represents sound, including the effects of the converted to binary, which is processed by a
sample rate and sample resolution computer
• The sample rate is the number of samples
taken in a second
• The sample resolution is the number of bits per
sample
• The accuracy of the recording and the file size
increases as the sample rate and resolution
increase
Back to contents page www.cambridgeinternational.org/olevel 12
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
1.2 Text, sound and images continued
Candidates should be able to: Notes and guidance
3 Understand how and why a computer • An image is a series of pixels that are converted
represents an image, including the effects of to binary, which is processed by a computer
the resolution and colour depth • The resolution is the number of pixels in the
image
• The colour depth is the number of bits used to
represent each colour
• The file size and quality of the image increase
as the resolution and colour depth increase
1.3 Data storage and compression
Candidates should be able to: Notes and guidance
1 Understand how data storage is measured • Including:
– bit
– nibble
– byte
– kibibyte (KiB)
– mebibyte (MiB)
– gibibyte (GiB)
– tebibyte (TiB)
– pebibyte (PiB)
– exbibyte (EiB)
• The amount of the previous denomination
present in the data storage size, e.g.:
– 8 bits in a byte
– 1024 mebibytes in a gibibyte
2 Calculate the file size of an image file and a • Answers must be given in the units specified
sound file, using information given in the question. Calculations must use the
measurement of 1024 and not 1000
• Information given may include:
– image resolution and colour depth
– sound sample rate, resolution and length of
track
3 Understand the purpose of and need for data • Compression exists to reduce the size of the file
compression • What the impact of this is, e.g.:
– less bandwidth required
– less storage space required
– shorter transmission time
Back to contents page www.cambridgeinternational.org/olevel 13
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
1.3 Data storage and compression continued
Candidates should be able to: Notes and guidance
4 Understand how files are compressed using • Lossy compression reduces the file size by
lossy and lossless compression methods permanently removing data, e.g. reducing
resolution or colour depth, reducing sample
rate or resolution
• Lossless compression reduces the file size
without permanent loss of data, e.g. run length
encoding (RLE)
2 Data transmission
2.1 Types and methods of data transmission
Candidates should be able to: Notes and guidance
1 (a) Understand that data is broken down into
packets to be transmitted
(b) Describe the structure of a packet • A packet of data contains a:
– packet header
– payload
– trailer
• The packet header includes the:
– destination address
– packet number
– originator’s address
(c) Describe the process of packet switching • Data is broken down into packets
• Each packet could take a different route
• A router controls the route a packet takes
• Packets may arrive out of order
• Once the last packet has arrived, packets are
reordered
2 (a) Describe how data is transmitted from one • Including:
device to another using different methods – serial
of data transmission
– parallel
– simplex
– half-duplex
– full-duplex
(b) Explain the suitability of each method of • Including the advantages and disadvantages of
data transmission, for a given scenario each method
3 Understand the universal serial bus (USB) • Including the benefits and drawbacks of the
interface and explain how it is used to transmit interface
data
Back to contents page www.cambridgeinternational.org/olevel 14
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
2.2 Methods of error detection
Candidates should be able to: Notes and guidance
1 Understand the need to check for errors after • Errors can occur during data transmission due
data transmission and how these errors can to interference, e.g. data loss, data gain and
occur data change
2 Describe the processes involved in each of the • Including parity byte and parity block check
following error detection methods for detecting
errors in data after transmission: parity check
(odd and even), checksum and echo check
3 Describe how a check digit is used to detect
errors in data entry and identify examples
of when a check digit is used, including
international standard book numbers (ISBN)
and bar codes
4 Describe how an automatic repeat query (ARQ) • Including the use of:
can be used to establish that data is received – positive/negative acknowledgements
without error
– timeout
2.3 Encryption
Candidates should be able to: Notes and guidance
1 Understand the need for and purpose of
encryption when transmitting data
2 Understand how data is encrypted using • Asymmetric encryption includes the use of
symmetric and asymmetric encryption public and private keys
Back to contents page www.cambridgeinternational.org/olevel 15
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
3 Hardware
3.1 Computer architecture
Candidates should be able to: Notes and guidance
1 (a) Understand the role of the central • The CPU processes instructions and data that
processing unit (CPU) in a computer are input into the computer so that the result
can be output
(b) Understand what is meant by a • A microprocessor is a type of integrated circuit
microprocessor on a single chip
2 (a) Understand the purpose of the • Including:
components in a CPU, in a computer that – units: arithmetic logic unit (ALU) and control
has a Von Neumann architecture unit (CU)
– registers: program counter (PC), memory
address register (MAR), memory data
register (MDR), current instruction register
(CIR) and accumulator (ACC)
– buses: address bus, data bus and control
bus
(b) Describe the process of the • How instructions and data are fetched from
fetch–decode–execute (FDE) cycle, random access memory (RAM) into the CPU,
including the role of each component in the how they are processed using each component
process and how they are then executed
• Storing data and addresses into specific
registers
• Using buses to transmit data, addresses and
signals
• Using units to fetch, decode and execute data
and instructions
3 Understand what is meant by a core, cache • The number of cores, size of the cache and
and clock in a CPU and explain how they can speed of the clock can affect the performance
affect the performance of a CPU of a CPU
4 Understand the purpose and use of an • An instruction set is a list of all the commands
instruction set for a CPU that can be processed by a CPU, and the
commands are machine code
5 Describe the purpose and characteristics of • An embedded system is used to perform a
an embedded system and identify devices in dedicated functions. For example in, domestic
which they are commonly used appliances, cars, security systems, lighting
systems or vending machines. This is different
to a general purpose computer that is used to
perform many different functions. For example
in, a personal computer (PC) or a laptop
Back to contents page www.cambridgeinternational.org/olevel 16
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
3.2 Input and output devices
Candidates should be able to: Notes and guidance
1 Understand what is meant by an input device • Including:
and why it is required – barcode scanner
– digital camera
– keyboard
– microphone
– optical mouse
– QR code scanner
– touch screen (resistive, capacitive and
infra-red)
– two-dimensional (2D) and three-dimensional
(3D) scanners
2 Understand what is meant by an output device • Including:
and why it is required – actuator
– digital light processing (DLP) projector
– inkjet printer
– laser printer
– light emitting diode (LED) screen
– liquid crystal display (LCD) projector
– liquid crystal display (LCD) screen
– speaker
– 3D printer
3 (a) Understand what is meant by a sensor and • Limited to:
the purposes of sensors – acoustic
– accelerometer
– flow
– gas
– humidity
– infra-red
– level
– light
– magnetic field
– moisture
– pH
– pressure
– proximity
– temperature
(b) Identify the type of data captured by each
sensor and understand when each sensor
would be used, including selecting the most
suitable sensor for a given context
Back to contents page www.cambridgeinternational.org/olevel 17
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
3.3 Data storage
Candidates should be able to: Notes and guidance
1 Understand what is meant by primary storage • Primary storage is directly accessed by the
CPU
• Including the role of:
– random access memory (RAM)
– read only memory (ROM)
• Including why a computer needs both RAM
and ROM, and the difference between them
2 Understand what is meant by secondary • Secondary storage is not directly accessed by
storage the CPU and is necessary for more permanent
storage of data
3 Describe the operation of magnetic, optical • Magnetic storage uses platters which are
and solid-state (flash memory) storage and give divided into tracks and sectors. Data is read
examples of each and written using electromagnets. Including
hard disk drive (HDD)
• Optical storage uses lasers to create and read
pits and lands. Including: CD, DVD and Blu-ray
• Solid-state (flash memory) uses NAND or NOR
technology. Transistors are used as control
gates and floating gates. Including: solid-state
drive (SSD), SD card and USB drive
4 Describe what is meant by virtual memory, how • Pages of data are transferred between RAM
it is created and used and why it is necessary and virtual memory when needed
5 Understand what is meant by cloud storage • Cloud storage can be accessed remotely in
comparison to storing data locally
6 Explain the advantages and disadvantages • Physical servers and storage are needed to
of storing data on the cloud in comparison to store data in cloud storage
storing it locally
Back to contents page www.cambridgeinternational.org/olevel 18
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
3.4 Network hardware
Candidates should be able to: Notes and guidance
1 Understand that a computer needs a network
interface card (NIC) to access a network
2 Understand what is meant by, and the purpose • A network interface card is given a MAC
of, a media access control (MAC) address, address at the point of manufacture
including its structure • MAC addresses are usually written as
hexadecimal
• MAC addresses are created using the
manufacturer code and the serial code
3 (a) Understand what is meant by, and the • An IP address is allocated by the network and it
purpose of, an internet protocol (IP) address can be static or dynamic
(b) Understand that there are different types of • Including the characteristics of, and differences
IP address between, IPv4 and IPv6
4 Describe the role of a router in a network • A router sends data to a specific destination on
a network
• A router can assign IP addresses
• A router can connect a local network to the
internet
4 Software
4.1 Types of software and interrupts
Candidates should be able to: Notes and guidance
1 Describe the difference between system • System software provides the services that the
software and application software and provide computer requires, including operating system
examples of each and utility software
• Application software provides the services that
the user requires
2 Describe the role and basic functions of an • Including:
operating system – managing files
– handling interrupts
– providing an interface
– managing peripherals and drivers
– managing memory
– managing multitasking
– providing a platform for running applications
– providing system security
– managing user accounts
Back to contents page www.cambridgeinternational.org/olevel 19
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
4.1 Types of software and interrupts continued
Candidates should be able to: Notes and guidance
3 Understand how hardware, firmware and • Applications are run on the operating system
an operating system are required to run • The operating system is run on the firmware
applications software
• The bootloader (firmware) is run on the
hardware
4 Describe the role and operation of interrupts • Including:
– how an interrupt is generated
– how it is handled using an interrupt service
routine
– what happens as a result of the interrupts
• Software interrupts include division by zero
and two processes trying to access the same
memory location
• Hardware interrupts include pressing a key on
the keyboard and moving the mouse
4.2 Types of programming language, translators and integrated development environments
(IDEs)
Candidates should be able to: Notes and guidance
1 Explain what is meant by a high-level language • Advantages and disadvantages include:
and a low-level language, including the – ease of reading and writing code,
advantages and disadvantages of each e.g. low-level is hard to read
– ease of debugging code
– machine independence
– direct manipulation of hardware
2 Understand that assembly language is a form
of low-level language that uses mnemonics,
and that an assembler is needed to translate an
assembly language program into machine code
3 Describe the operation of a compiler and an • A compiler translates the whole code at once
interpreter, including how high-level language is before executing it, producing an executable file
translated by each and how errors are reported • An interpreter translates and executes the code
line-by-line
• A compiler provides an error report for the
whole code if errors are detected
• An interpreter stops execution when an error is
found
Back to contents page www.cambridgeinternational.org/olevel 20
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
4.2 Types of programming language, translators and integrated development environments
(IDEs) continued
Candidates should be able to: Notes and guidance
4 Explain the advantages and disadvantages of a • Including an understanding that an interpreter is
compiler and an interpreter mostly used when developing a program and a
compiler is used to translate the final program
5 Explain the role of an IDE in writing program • Including:
code and the common functions IDEs provide – code editors
– run-time environment
– translators
– error diagnostics
– auto-completion
– auto-correction
– prettyprint
5 The internet and its uses
5.1 The internet and the world wide web
Candidates should be able to: Notes and guidance
1 Understand the difference between the internet • The internet is the infrastructure
and the world wide web • The world wide web is the collection of
websites and web pages accessed using the
internet
2 Understand what is meant by a uniform • A URL is a text-based address for a web page;
resource locator (URL) it can contain the protocol, the domain name
and the web page/file name
3 Describe the purpose and operation of
hypertext transfer protocol (HTTP) and
hypertext transfer protocol secure (HTTPS)
4 Explain the purpose and functions of a web • The main purpose of a web browser is to
browser render hypertext markup language (HTML) and
display web pages
• Functions include:
– storing bookmarks and favourites
– recording user history
– allowing use of multiple tabs
– storing cookies
– providing navigation tools
– providing an address bar
Back to contents page www.cambridgeinternational.org/olevel 21
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
5.1 The internet and the world wide web continued
Candidates should be able to: Notes and guidance
5 Describe how web pages are located, retrieved • Including the role of:
and displayed on a device when a user enters a – the web browser
URL
– IP addresses
– the domain name server (DNS)
– the web server
– HTML
6 Explain what is meant by cookies and how • Cookies are used for functions, including:
they are used, including session cookies and – saving personal details
persistent cookies
– tracking user preferences
– holding items in an online shopping cart
– storing login details
5.2 Digital currency
Candidates should be able to: Notes and guidance
1 Understand the concept of a digital currency • A digital currency is one that only exists
and how digital currencies are used electronically
2 Understand the process of blockchain and how • Blockchain, in its basic form, is a digital ledger,
it is used to track digital currency transactions that is a time-stamped series of records that
cannot be altered
5.3 Cyber security
Candidates should be able to: Notes and guidance
1 Describe the processes involved in, and the • Including:
aim of carrying out, a range of cyber security – brute-force attack
threats
– data interception
– distributed denial of service (DDoS) attack
– hacking
– malware (virus, worm, Trojan horse,
spyware, adware, ransomware)
– pharming
– phishing
– social engineering
Back to contents page www.cambridgeinternational.org/olevel 22
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
5.3 Cyber security continued
Candidates should be able to: Notes and guidance
2 Explain how a range of solutions are used to • Including:
help keep data safe from security threats – access levels
– anti-malware, including anti-virus and
anti-spyware
– authentication (username and password,
biometrics, two-step verification)
– automating software updates
– checking the spelling and tone of
communications
– checking the URL attached to a link
– firewalls
– privacy settings
– proxy-servers
– secure socket layer (SSL) security protocol
6 Automated and emerging technologies
6.1 Automated systems
Candidates should be able to: Notes and guidance
1 Describe how sensors, microprocessors and
actuators can be used in collaboration to create
automated systems
2 Describe the advantages and disadvantages of • Including scenarios from:
an automated system used for a given scenario – industry
– transport
– agriculture
– weather
– gaming
– lighting
– science
Back to contents page www.cambridgeinternational.org/olevel 23
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
6.2 Robotics
Candidates should be able to: Notes and guidance
1 Understand what is meant by robotics • Robotics is a branch of computer science that
incorporates the design, construction and
operation of robots
• Examples include factory equipment, domestic
robots and drones
2 Describe the characteristics of a robot • Including:
– a mechanical structure or framework
– electrical components, such as sensors,
microprocessors and actuators
– programmable
3 Understand the roles that robots can • Robots can be used in areas including:
perform and describe the advantages and – industry
disadvantages of their use
– transport
– agriculture
– medicine
– domestic settings
– entertainment
6.3 Artificial intelligence
Candidates should be able to: Notes and guidance
1 Understand what is meant by artificial • AI is a branch of computer science dealing
intelligence (AI) with the simulation of intelligent behaviours by
computers
2 Describe the main characteristics of AI as the
collection of data and the rules for using that
data, the ability to reason, and it can include
the ability to learn and adapt
3 Explain the basic operation and components of • Limited to:
AI systems to simulate intelligent behaviour – expert systems
– machine learning
• Expert systems have a knowledge base, a rule
base, an inference engine and an interface
• Machine learning is when a program has the
ability to automatically adapt its own processes
and/or data
Back to contents page www.cambridgeinternational.org/olevel 24
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
Algorithms, programming and logic
See section 4 for the:
• standard flowchart symbols that must be used by students when drawing flowcharts
• logic gate symbols that must be used by students when drawing logic circuits
• format in which pseudocode will appear in examinations.
In Paper 2, candidates are expected to write solutions to given problems using the methods and concepts
listed in topics 7 to 10.
Where the solution to a problem involves coding, candidates are required to write solutions in pseudocode.
Solutions written in programming code will not be awarded marks. The exception is the 15-mark scenario
question.
In the 15-mark scenario question, candidates are required to write solutions to the given problem using
pseudocode or their choice of one of the following programming languages: Python, Visual Basic or Java.
Solutions written in other programming languages will not be awarded marks.
7 Algorithm design and problem-solving
Candidates should be able to: Notes and guidance
1 Understand the program development life • Including identifying each stage and performing
cycle, limited to: analysis, design, coding and these tasks for each stage:
testing – analysis: abstraction, decomposition of the
problem, identification of the problem and
requirements
– design: decomposition, structure diagrams,
flowcharts, pseudocode
– coding: writing program code and iterative
testing
– testing: testing program code with the use
of test data
2 (a) Understand that every computer system is
made up of sub-systems, which are made
up of further sub-systems
(b) Understand how a problem can be • Including:
decomposed into its component parts – inputs
– processes
– outputs
– storage
(c) Use different methods to design and • Including:
construct a solution to a problem – structure diagrams
– flowcharts
– pseudocode
3 Explain the purpose of a given algorithm • Including:
– stating the purpose of an algorithm
– describing the processes involved in an
algorithm
Back to contents page www.cambridgeinternational.org/olevel 25
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
7 Algorithm design and problem-solving continued
Candidates should be able to: Notes and guidance
4 Understand standard methods of solution • Limited to:
– linear search
– bubble sort
– totalling
– counting
– finding maximum, minimum and average
values
5 (a) Understand the need for validation checks • Including:
to be made on input data and the different – range check
types of validation check
– length check
– type check
– presence check
– format check
– check digit
(b) Understand the need for verification checks • Including:
to be made on input data and the different – visual check
types of verification check
– double entry check
6 Suggest and apply suitable test data • Limited to:
– normal
– abnormal
– extreme
– boundary
• Extreme data is the largest/smallest acceptable
value
• Boundary data is the largest/smallest
acceptable value and the corresponding
smallest/largest rejected value
7 Complete a trace table to document a dry-run • Including, at each step in an algorithm:
of an algorithm – variables
– outputs
– user prompts
8 Identify errors in given algorithms and suggest
ways of correcting these errors
9 Write and amend algorithms for given problems • Precision is required when writing algorithms,
or scenarios, using: pseudocode, program e.g. x > y is acceptable but
code and flowcharts x is greater than y is not acceptable
• See section 4 for flowchart symbols
• See section 4 for pseudocode
Back to contents page www.cambridgeinternational.org/olevel 26
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
8 Programming
8.1 Programming concepts
Candidates should be able to: Notes and guidance
1 Declare and use variables and constants
2 Understand and use basic data types • Including:
– integer
– real
– char
– string
– Boolean
3 Understand and use input and output
4 (a) Understand and use the concept of
sequence
(b) Understand and use the concept of • Including:
selection – IF statements
– CASE statements
(c) Understand and use the concept of • Including:
iteration – count-controlled loops
– pre-condition loops
– post-condition loops
(d) Understand and use the concepts of
totalling and counting
(e) Understand and use the concept of string • Including:
handling – length
– substring
– upper
– lower
• The first character of the string can be position
zero or one
Back to contents page www.cambridgeinternational.org/olevel 27
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
8.1 Programming concepts continued
Candidates should be able to: Notes and guidance
(f) Understand and use arithmetic, relational • Arithmetic, limited to:
and logical operators – +
– –
– /
– *
– ^ (raised to power of)
– MOD
– DIV
• Relational, limited to:
– =
– <
– <=
– >
– >=
– <> (not equal to)
• Logical, limited to:
– AND
– OR
– NOT
5 Understand and use nested statements • Including nested selection and iteration
• Candidates will not be required to write more
than three levels of nested statements
6 (a) Understand what is meant by procedures,
functions and parameters
(b) Define and use procedures and functions, • Procedures and functions may have up to two
with or without parameters parameters
(c) Understand and use local and global
variables
7 Understand and use library routines • Including:
– MOD
– DIV
– ROUND
– RANDOM
Back to contents page www.cambridgeinternational.org/olevel 28
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
8.1 Programming concepts continued
Candidates should be able to: Notes and guidance
8 Understand how to create a maintainable • Including appropriate use of:
program – meaningful identifiers
– the commenting feature provided by the
programming language
– procedures and functions
– relevant and appropriate commenting of
syntax
• Use meaningful identifiers for:
– variables
– constants
– arrays
– procedures and functions
8.2 Arrays
Candidates should be able to: Notes and guidance
1 Declare and use one-dimensional (1D) and
two-dimensional (2D) arrays
2 Understand the use of arrays • Including the use of variables as indexes in
arrays
3 Write values into, and read values from, an • The first index can be zero or one
array using iteration • Including nested iteration
8.3 File handling
Candidates should be able to: Notes and guidance
1 Understand the purpose of storing data in a file
to be used by a program
2 Open, close and use a file for reading and • Including:
writing – read and write single items of data
– read and write a line of text
Back to contents page www.cambridgeinternational.org/olevel 29
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
9 Databases
Candidates should be able to: Notes and guidance
1 Define a single-table database from given data • Including:
storage requirements – fields
– records
– validation
2 Suggest suitable basic data types • Including:
– text/alphanumeric
– character
– Boolean
– integer
– real
– date/time
3 Understand the purpose of a primary key
and identify a suitable primary key for a given
database table
4 Read, understand and complete structured • Limited to:
query language (SQL) scripts to query data – SELECT
stored in a single database table
– FROM
– WHERE
– ORDER BY DESCENDING
– ORDER BY ASCENDING
– SUM
– COUNT
– AND
– OR
• Identifying the output given by an SQL
statement that will query the given contents of a
database table
Back to contents page www.cambridgeinternational.org/olevel 30
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Subject content
10 Boolean logic
Candidates should be able to: Notes and guidance
1 Identify and use the standard symbols for logic • See section 4 for logic gate symbols
gates
2 Define and understand the functions of logic • Including:
gates – NOT
– AND
– OR
– NAND
– NOR
– XOR (EOR)
– the binary output produced from all the
possible binary inputs
• NOT is a single input gate
• All other gates are limited to two inputs
3 (a) Use logic gates to create given logic circuits • Circuits must be drawn for the statement given,
from a: without simplification
(i) problem statement • Logic circuits will be limited to a maximum of
(ii) logic expression three inputs and one output
(iii) truth table
(b) Complete a truth table from a: • An example truth table with three inputs, for
(i) problem statement completion:
(ii) logic expression A B C Output
(iii) logic circuit 0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
(c) Write a logic expression from a:
(i) problem statement
(ii) logic circuit
(iii) truth table
Back to contents page www.cambridgeinternational.org/olevel 31
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028.
4 Details of the assessment
Paper 1 – Computer Systems
Written paper, 1 hour 45 minutes, 75 marks
This question paper consists of short-answer and structured questions set on Topics 1–6 of the subject
content.
All questions are compulsory, and candidates answer on the question paper.
This paper assesses all assessment objectives, AO1, AO2 and AO3, and assesses the full grade range, A* to G.
This paper is externally assessed.
Calculators are not allowed in this examination.
Paper 2 – Algorithms, Programming and Logic
Written paper, 1 hour 45 minutes, 75 marks
This question paper consists of short-answer and structured questions set on Topics 7–10 of the subject
content.
All questions are compulsory, and candidates answer on the question paper.
The questions require candidates to have practical programming experience.
Knowledge of programming language syntax is not examined; in all cases the logic is more important than the
syntax.
This paper assesses all assessment objectives, AO1, AO2 and AO3, and assesses the full grade range, A* to G.
This paper is externally assessed.
Calculators are not allowed in this examination.
Scenario question
The final question in Paper 2 is a 15-mark unseen scenario question using the methods and concepts listed in
Topics 7-10 of the subject content.
Candidates will be required to write an algorithm using pseudocode or program code for the context provided.
It is expected that candidates should spend 30 minutes answering this question.
Teachers are advised to familiarise themselves with the updated Paper 2 specimen paper and mark scheme for
first assessment 2023, which provide an example of the scenario question, how it will be marked, and include
an indicative 15-mark response.
Back to contents page www.cambridgeinternational.org/olevel 32
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Mathematical requirements
Calculators are not permitted in IGCSE Computer Science examinations.
Candidates should be able to:
• add, subtract, multiply and divide
• use averages, random numbers, decimals, fractions, percentages and ratios
• use both positive and negative integers, and real numbers
• use arithmetic and Boolean operators
• use different number systems, including binary, denary and hexadecimal
• use methods of counting, totalling and rounding.
Flowchart symbols
Flow line An arrow represents control passing
between the connected shapes.
Process This shape represents something being
performed or done.
Subroutine This shape represents a subroutine call that
will relate to a separate, non-linked flowchart.
Input/Output This shape represents the input or output of
something into or out of the flowchart.
Decision This shape represents a decision
(Yes/No or True/False) that results in two
lines representing the different possible
outcomes.
Terminator This shape represents the ‘Start’ and ‘Stop’
of the process.
Back to contents page www.cambridgeinternational.org/olevel 33
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Logic gate symbols
NOT
AND
OR
NAND
NOR
XOR (EOR)
Back to contents page www.cambridgeinternational.org/olevel 34
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Pseudocode
The following information sets out how pseudocode will appear within the examinations of this syllabus. The
numbers and letters that appear at the end of a sub-heading provide a cross reference to the relevant section
of the subject content.
General style
Font style and size
Pseudocode is presented in Courier New. The size of the font will be consistent throughout.
Indentation
Lines are indented by four spaces to indicate that they are contained within a statement in a previous line.
Where it is not possible to fit a statement on one line, any continuation lines are indented by two spaces from
the margin. In cases where line numbering is used, this indentation may be omitted. Every effort will be made to
make sure that code statements are not longer than a line of code, unless this is necessary.
Note that the THEN and ELSE clauses of an IF statement are indented by only two spaces. Cases in CASE
statements are also indented by only two spaces.
Case
Keywords are in upper case, e.g. IF, REPEAT, PROCEDURE.
Identifiers are in mixed case with upper case letters indicating the beginning of new words, e.g.
NumberOfPlayers.
Meta-variables – (symbols in the pseudocode that should be substituted by other symbols) are enclosed in
angled brackets < >.
Example – meta-variables
REPEAT
<Statements>
UNTIL <Condition>
Lines and line numbering
Each line representing a statement is numbered. However, when a statement runs over one line of text, the
continuation lines are not numbered.
Back to contents page www.cambridgeinternational.org/olevel 35
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Comments
Comments are preceded by two forward slashes: //. The comment continues until the end of the line. For
multi‑line comments, each line is preceded by //.
Normally the comment is on a separate line before, and at the same level of indentation as, the code it refers
to. Occasionally, however, a short comment that refers to a single line may be at the end of the line to which it
refers.
Example – comments
// This procedure swaps
// values of X and Y
PROCEDURE SWAP(X : INTEGER, Y : INTEGER)
Temp ← X // temporarily store X
X ← Y
Y ← Temp
ENDPROCEDURE
Variables, constants and data types
Basic data types (8.1.2)
The following keywords are used to designate basic data types:
• INTEGER a whole number
• REAL a number capable of containing a fractional part
• CHAR a single character
• STRING a sequence of zero or more characters
• BOOLEAN the logical values TRUE and FALSE
Literals
Literals of the above data types are written as follows:
• Integer written as normal in the denary system, e.g. 5, –3
• Real always written with at least one digit on either side of the decimal point, zeros being
added if necessary, e.g. 4.7, 0.3, –4.0, 0.0
• Char a single character delimited by single quotes, e.g. ꞌxꞌ, ꞌcꞌ, ꞌ@ꞌ
• String delimited by double quotes. A string may contain no characters (i.e. the empty string),
e.g. “This is a string”, “”
• Boolean TRUE, FALSE
Identifiers
Identifiers (the names given to variables, constants, procedures and functions) are in mixed case using Pascal
case, e.g. FirstName. They can only contain letters (A–Z, a–z) and digits (0–9). They must start with a capital
letter and not a digit. Accented letters and other characters, including the underscore, should not be used.
As in programming, it is good practice to use identifier names that describe the variable, procedure or function
to which they refer. Single letters may be used where these are conventional (such as i and j when dealing
with array indices, or X and Y when dealing with coordinates) as these are made clear by the convention.
Back to contents page www.cambridgeinternational.org/olevel 36
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Keywords should never be used as identifier names.
Identifiers should be considered case insensitive, for example, Countdown and CountDown should not be
used as separate variables.
Variable declarations (8.1.1)
Declarations are made as follows:
DECLARE <identifier> : <data type>
Example – variable declarations
DECLARE Counter : INTEGER
DECLARE TotalToPay : REAL
DECLARE GameOver : BOOLEAN
Constants (8.1.1)
It is good practice to use constants if this makes the pseudocode more readable, and easier to update if the
value of the constant changes.
Constants are declared by stating the identifier and the literal value in the following format:
CONSTANT <identifier> ← <value>
Example – CONSTANT declarations
CONSTANT HourlyRate ← 6.50
CONSTANT DefaultText ← "N/A"
Only literals can be used as the value of a constant. A variable, another constant or an expression must never
be used.
Back to contents page www.cambridgeinternational.org/olevel 37
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Assignments
The assignment operator is ←
Assignments should be made in the following format:
<identifier> ← <value>
The identifier must refer to a variable (this can be an individual element in a data structure, such as an array or
an abstract data type). The value may be any expression that evaluates to a value of the same data type as the
variable.
Example – assignments
Counter ← 0
Counter ← Counter + 1
TotalToPay ← NumberOfHours * HourlyRate
Arrays
Declaring arrays (8.2.1)
Arrays are fixed-length structures of elements of identical data type, accessible by consecutive index numbers.
It is good practice to explicitly state what the lower bound of the array (i.e. the index of the first element) is
because this defaults to either 0 or 1 in different systems. Generally, a lower bound of 1 will be used.
Square brackets are used to indicate the array indices.
1D and 2D arrays are declared as follows (where l, l1, l2 are lower bounds and u, u1, u2 are upper bounds):
DECLARE <identifier> : ARRAY[<l>:<u>] OF <data type>
DECLARE <identifier> : ARRAY[<l1>:<u1>, <l2>:<u2>] OF <data type>
Example – array declaration
DECLARE StudentNames : ARRAY[1:30] OF STRING
DECLARE NoughtsAndCrosses : ARRAY[1:3, 1:3] OF CHAR
Using arrays (8.2.1)
In the main pseudocode statements, only one index value is used for each dimension in the square brackets.
Example – using arrays
StudentNames[1] ← "Ali"
NoughtsAndCrosses[2,3] ← ꞌXꞌ
StudentNames[n+1] ← StudentNames[n]
Back to contents page www.cambridgeinternational.org/olevel 38
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
An appropriate loop structure is used to assign the elements individually.
Example – assigning a group of array elements
FOR Index ← 1 TO 30
StudentNames[Index] ← ""
NEXT Index
Common operations
Input and output (8.1.3)
Values are input using the INPUT command as follows:
INPUT <identifier>
The identifier should be a variable (that may be an individual element of a data structure, such as an array).
Values are output using the OUTPUT command as follows:
OUTPUT <value(s)>
Several values, separated by commas, can be output using the same command.
Examples – INPUT and OUTPUT statements
INPUT Answer
OUTPUT Score
OUTPUT "You have ", Lives, " lives left"
Arithmetic operations (8.1.4 (f))
Standard arithmetic operator symbols are used:
+ addition
– subtraction
* multiplication
/ division
^ raised to the power of
Examples – arithmetic operations
Answer ← Score * 100 / MaxMark
Answer ← Pi * Radius ^ 2
Back to contents page www.cambridgeinternational.org/olevel 39
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
The integer division operators MOD and DIV can also be used.
DIV(<identifier1>, <identifier2>)
Returns the quotient of identifier1 divided by identifier2 with the fractional part discarded.
MOD(<identifier1>, <identifier2>)
Returns the remainder of identifier1 divided by identifier2
The identifiers are of data type integer.
Examples – MOD and DIV
DIV(10, 3) returns 3
MOD(10, 3) returns 1
Multiplication and division have higher precedence over addition and subtraction (this is the normal
mathematical convention). However, it is good practice to make the order of operations in complex expressions
explicit by using parentheses.
Logical operators (8.1.4 (f))
The following symbols are used for logical operators:
= equal to
< less than
<= less than or equal to
> greater than
>= greater than or equal to
<> not equal to
The result of these operations is always of data type BOOLEAN.
In complex expressions, it is advisable to use parentheses to make the order of operations explicit.
Boolean operators (8.1.4 (f))
The only Boolean operators used are AND, OR and NOT. The operands and results of these operations are
always of data type BOOLEAN.
In complex expressions, it is advisable to use parentheses to make the order of operations explicit.
Examples – Boolean operations
IF Answer < 0 OR Answer > 100
THEN
Correct ← FALSE
ELSE
Correct ← TRUE
ENDIF
Back to contents page www.cambridgeinternational.org/olevel 40
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
String operations (8.1.4 (e))
LENGTH(<identifier>)
Returns the integer value representing the length of string. The identifier should be of data type string.
LCASE(<identifier>)
Returns the string/character with all characters in lower case. The identifier should be of data type string or
char.
UCASE(<identifier>)
Returns the string/character with all characters in upper case. The identifier should be of data type string or
char.
SUBSTRING(<identifier>, <start>, <length>)
Returns a string of length length starting at position start. The identifier should be of data type string,
length and start should be positive, and data type integer.
Generally, a start position of 1 is the first character in the string.
Example – string operations
LENGTH("Happy Days") will return 10
LCASE(ꞌWꞌ) will return ꞌwꞌ
UCASE("Happy") will return "HAPPY"
SUBSTRING("Happy Days", 1, 5) will return "Happy"
Other library routines (8.1.7)
ROUND(<identifier>, <places>)
Returns the value of the identifier rounded to places number of decimal places.
The identifier should be of data type real; places should be data type integer.
RANDOM()
Returns a random number between 0 and 1 inclusive.
Example – ROUND and RANDOM
Value ← ROUND (RANDOM() * 6, 0) // returns a whole number between 0 and 6
Back to contents page www.cambridgeinternational.org/olevel 41
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Selection
IF statements (8.1.4 (b) and 8.1.5)
IF statements may or may not have an ELSE clause.
IF statements without an ELSE clause are written as follows:
IF <condition>
THEN
<statements>
ENDIF
IF statements with an ELSE clause are written as follows:
IF <condition>
THEN
<statements>
ELSE
<statements>
ENDIF
Note that the THEN and ELSE clauses are only indented by two spaces. (They are, in a sense, a continuation of
the IF statement rather than separate statements.)
When IF statements are nested, the nesting should continue the indentation of two spaces.
Example – nested IF statements
IF ChallengerScore > ChampionScore
THEN
IF ChallengerScore > HighestScore
THEN
OUTPUT ChallengerName, " is champion and highest scorer"
ELSE
OUTPUT Player1Name, " is the new champion"
ENDIF
ELSE
OUTPUT ChampionName, " is still the champion"
IF ChampionScore > HighestScore
THEN
OUTPUT ChampionName, " is also the highest scorer"
ENDIF
ENDIF
Back to contents page www.cambridgeinternational.org/olevel 42
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
CASE statements (8.1.4 (b))
CASE statements allow one out of several branches of code to be executed, depending on the value of a
variable.
CASE statements are written as follows:
CASE OF <identifier>
<value 1> : <statement>
<value 2> : <statement>
...
ENDCASE
An OTHERWISE clause can be the last case:
CASE OF <identifier>
<value 1> : <statement>
<value 2> : <statement>
...
OTHERWISE <statement>
ENDCASE
It is best practice to keep the branches to single statements as this makes the pseudocode more readable.
Similarly, single values should be used for each case. If the cases are more complex, the use of an IF
statement, rather than a CASE statement, should be considered.
Each case clause is indented by two spaces. They can be considered as continuations of the CASE statement
rather than new statements.
Note that the case clauses are tested in sequence. When a case that applies is found, its statement is
executed, and the CASE statement is complete. Control is passed to the statement after the ENDCASE. Any
remaining cases are not tested.
If present, an OTHERWISE clause must be the last case. Its statement will be executed if none of the preceding
cases apply.
Example – formatted CASE statement
INPUT Move
CASE OF Move
ꞌWꞌ : Position ← Position – 10
ꞌEꞌ : Position ← Position + 10
ꞌAꞌ : Position ← Position – 1
ꞌDꞌ : Position ← Position + 1
OTHERWISE OUTPUT "Beep"
ENDCASE
Back to contents page www.cambridgeinternational.org/olevel 43
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Iteration
Count-controlled (FOR) loops (8.1.4 (c))
Count-controlled loops are written as follows:
FOR <identifier> ← <value1> TO <value2>
<statements>
NEXT <identifier>
The identifier must be a variable of data type INTEGER, and the values should be expressions that evaluate to
integers.
The variable is assigned each of the integer values from value1 to value2 inclusive, running the statements
inside the FOR loop after each assignment. If value1 = value2, the statements will be executed once, and if
value1 > value2, the statements will not be executed.
An increment can be specified as follows:
FOR <identifier> ← <value1> TO <value2> STEP <increment>
<statements>
NEXT <identifier>
The increment must be an expression that evaluates to an integer. In this case the identifier will be
assigned the values from value1 in successive increments of increment until it reaches value2. If it goes
past value2, the loop terminates. The increment can be negative.
Example – nested FOR loops
Total ← 0
FOR Row ← 1 TO MaxRow
RowTotal ← 0
FOR Column ← 1 TO 10
RowTotal ← RowTotal + Amount[Row, Column]
NEXT Column
OUTPUT "Total for Row ", Row, " is ", RowTotal
Total ← Total + RowTotal
NEXT Row
OUTPUT "The grand total is ", Total
Back to contents page www.cambridgeinternational.org/olevel 44
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Post-condition (REPEAT) loops (8.1.4 (c))
Post-condition loops are written as follows:
REPEAT
<statements>
UNTIL <condition>
The condition must be an expression that evaluates to a Boolean. The statements in the loop will be executed
at least once. The condition is tested after the statements are executed, and if it evaluates to TRUE, the loop
terminates, otherwise the statements are executed again.
Example – REPEAT UNTIL statement
REPEAT
OUTPUT "Please enter the password"
INPUT Password
UNTIL Password = "Secret"
Pre-condition (WHILE) loops (8.1.4 (c))
Pre-condition loops are written as follows:
WHIL
E <condition> DO
<statements>
ENDWHILE
The condition must be an expression that evaluates to a Boolean. The condition is tested before the
statements, and the statements will only be executed if the condition evaluates to TRUE. After the statements
have been executed, the condition is tested again. The loop terminates when the condition evaluates to FALSE.
The statements will not be executed if, on the first test, the condition evaluates to FALSE.
Example – WHILE loop
WHIL
E Number > 9 DO
Number ← Number – 9
ENDWHILE
Back to contents page www.cambridgeinternational.org/olevel 45
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Procedures and functions
Procedures and functions are defined at the start of the code.
Defining and calling procedures (8.1.6 (b))
A procedure with no parameters is defined as follows:
PROCEDURE <identifier>
<statements>
ENDPROCEDURE
A procedure with parameters is defined as follows:
PROCEDURE <identifier>(<param1>:<datatype>, <param2>:<datatype>...)
<statements>
ENDPROCEDURE
The <identifier> is the identifier used to call the procedure. Where used, param1, param2, etc. are
identifiers for the parameters of the procedure. These will be used as variables in the statements of the
procedure.
Procedures should be called as follows:
CALL <identifier>
CALL <identifier>(Value1,Value2...)
These calls are complete program statements.
When parameters are used, Value1, Value2... must be of the correct data type as in the definition of the
procedure.
When the procedure is called, control is passed to the procedure. If there are any parameters, these are
substituted by their values, and the statements in the procedure are executed. Control is then returned to the
line that follows the procedure call.
Back to contents page www.cambridgeinternational.org/olevel 46
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Example – use of procedures with and without parameters
PROCEDURE DefaultLine
CALL LINE(60)
ENDPROCEDURE
PROCEDURE Line(Size : INTEGER)
DECLARE Length : INTEGER
FOR Length ← 1 TO Size
OUTPUT '-'
NEXT Length
ENDPROCEDURE
IF MySize = Default
THEN
CALL DefaultLine
ELSE
CALL Line(MySize)
ENDIF
Defining and calling functions (8.1.6 (b))
Functions operate in a similar way to procedures, except that in addition they return a single value to the point
at which they are called. Their definition includes the data type of the value returned.
A function with no parameters is defined as follows:
FUNCTION <identifier> RETURNS <data type>
<statements>
ENDFUNCTION
A function with parameters is defined as follows:
FUNCTION <identifier>(<param1>:<datatype>, <param2>:<datatype>...) RETURNS <data type>
<statements>
ENDFUNCTION
The keyword RETURN is used as one of the statements within the body of the function to specify the value to
be returned. Normally, this will be the last statement in the function definition.
Because a function returns a value that is used when the function is called, function calls are not complete
program statements. The keyword CALL should not be used when calling a function. Functions should only
be called as part of an expression. When the RETURN statement is executed, the value returned replaces the
function call in the expression and the expression is then evaluated.
Back to contents page www.cambridgeinternational.org/olevel 47
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Example – definition and use of a function
FUNCTION SumSquare(Number1:INTEGER, Number2:INTEGER) RETURNS INTEGER
RETURN Number1 * Number1 + Number2 * Number2
ENDFUNCTION
OUTPUT "Sum of squares = ", SumSquare(10, 20)
File handling
Handling files (8.3.2)
It is good practice to explicitly open a file, stating the mode of operation, before reading from or writing to it.
This is written as follows:
OPENFILE <File identifier> FOR <File mode>
The file identifier will be the name of the file with data type string. The following file modes are used:
• READ for data to be read from the file
• WRITE for data to be written to the file. A new file will be created and any existing data in the file will be
lost.
A file should be opened in only one mode at a time.
Data is read from the file (after the file has been opened in READ mode) using the READFILE command as
follows:
READFILE <File Identifier>, <Variable>
When the command is executed, the data item is read and assigned to the variable.
Data is written into the file after the file has been opened using the WRITEFILE command as follows:
WRITEFILE <File identifier>, <Variable>
When the command is executed, the data is written into the file. Files should be closed when they are no longer
needed using the CLOSEFILE command as follows:
CLOSEFILE <File identifier>
Example – file handling operations
This example uses the operations together, to copy a line of text from FileA.txt to FileB.txt
DECLARE LineOfText : STRING
OPENFILE "FileA.txt" FOR READ
OPENFILE "FileB.txt" FOR WRITE
READFILE "FileA.txt", LineOfText
WRITEFILE "FileB.txt", LineOfText
CLOSEFILE "FileA.txt"
CLOSEFILE "FileB.txt"
Back to contents page www.cambridgeinternational.org/olevel 48
Cambridge O Level Computer Science 2210 syllabus for 2026, 2027 and 2028. Details of the assessment
Command words
Command words and their meanings help candidates know what is expected from them in the exams. The
table below includes command words used in the assessment for this syllabus. The use of the command word
will relate to the subject context.
Command word What it means
Calculate work out from given facts, figures or information
Compare identify/comment on similarities and/or differences
Define give precise meaning
Demonstrate show how or give an example
Describe state the points of a topic / give characteristics and main features
Evaluate judge or calculate the quality, importance, amount, or value of something
Explain set out purposes or reasons / make the relationships between things clear / say why
and/or how and support with relevant evidence
Give produce an answer from a given source or recall/memory
Identify name/select/recognise
Outline set out the main points
Show (that) provide structured evidence that leads to a given result
State express in clear terms
Suggest apply knowledge and understanding to situations where there are a range of valid
responses in order to make proposals / put forward considerations
Back to contents page www.cambridgeinternational.org/olevel 49