Computer Science 9618/31 May/June 2025: question paper and mark scheme
Cambridge AS & A Level Computer Science (9618), Paper 3 Advanced Theory, May/June 2025. Read both free below, or download them. Done the paper? Get it marked by AI against this mark scheme.
A programmer is writing a program to manage bookings for a small taxi company. The programmer requires some user-defined data types.
(a) Write a pseudocode statement to declare the enumerated data type, Vehicle, to hold the identity code of each of the company’s taxis:
M100, M230, T101, T102, T120, T150
…… [2]
(b) Write pseudocode statements to declare the composite data type, Booking, to hold data about taxi bookings. The data required includes:
• booking number (any combination of letters and numbers)
• destination
• client name
• client telephone number
• date of departure
• address for pick-up
• the identity code of the taxi used.
Use the most appropriate data type in each case, including the enumerated data type from part (a).
Mark scheme
1(a) One mark per mark point 2
MP1 TYPE Vehicle =
MP2 (M100, M230, T101, T102, T120, T150)
Example answer:
TYPE Vehicle = (M100, M230, T101, T102, T120, T150)
1(b) One mark per mark point 4
MP1 TYPE Booking and ENDTYPE correct
MP2 Declare used correctly for every field in the response
MP3 Any four fields correct
MP4 Remaining fields correct
Example answer:
TYPE Booking
DECLARE BookingNumber : STRING
DECLARE Destination : STRING
DECLARE ClientName : STRING
DECLARE ClientTelephone : STRING
DECLARE DateOfDeparture : DATE
DECLARE PickupAddress : STRING
DECLARE TaxiUsed : Vehicle
ENDTYPE
Numbers are stored in a computer using binary floating-point representation with:
• 10 bits for the mantissa
• 6 bits for the exponent
• two’s complement form for both the mantissa and the exponent.
(a) Write the normalised floating-point representation of the following binary number using this system.
0.00000011010111
Mantissa Exponent
[2]
(b) Calculate the normalised binary floating-point representation of –25.3125 in this system.
Show your working.
Mantissa Exponent
Working ……
[4]
Mark scheme
2(a) One mark per mark point 2
MP1 Correct mantissa
MP2 Correct exponent
Mantissa Exponent
0 1 1 0 1 0 1 1 1 0 1 1 1 0 1 0
2(b) One mark per mark point for working (Max 2) 4
• number converted to binary e.g., positive binary version of 25.3125 = (0)11001.0101
• two’s complement version
bits flipped and 1 added = 100110.1011
• -32 + 4 + 2 + 0.5 + 0.125 + 0.0625 // -32 + 4 + 2 + 1/2 + 1/8 + 1/16
• movement of binary point seen (5 places)
One mark per mark point
• correct mantissa
• correct exponent
Mantissa Exponent
1 0 0 1 1 0 1 0 1 1 0 0 0 1 0 1
(a) The Application Layer and Transport Layer are two layers of the TCP/IP protocol suite.
Describe the purpose of the Application Layer and the purpose of the Transport Layer.
Purpose of Application Layer ……
Purpose of Transport Layer ……
[5]
(b) Describe packet switching as a method of transmitting messages across the internet.
…… [4]
Mark scheme
3(a) One mark per mark point (Max 5) 5
One mark per mark point for purpose of Application Layer (Max 3)
MP1 To provide services / interface with the user // access to applications, for example login, file transfer, network file
access, email, etc
MP2 To provide mechanisms for securing communication e.g. encryption/authentication
MP3 To define/provide protocols used to allow the exchange of data/communication // to contain programs that
exchange data
MP4 Error detection and recovery mechanisms to handle application specific errors
One mark per mark point for purpose of Transport Layer (Max 3)
MP5 To provide logical communication between applications running on different hosts // To ensure that data is
delivered to the correct application process on the destination machine
MP6 To ensure error-free, end-to-end delivery of data between a source and a destination, in sequence // to provide
error recovery techniques such as error detection codes and automatic repeat request
MP7 To break data into segments when sent and to reconstruct when received // To reassemble segments at
destination
MP8 To regulate network connections // to provide flow control mechanisms to prevent data loss.
3(b) One mark per mark point (Max 4) 4
MP1 Data are broken into equal sized packets
MP2 Data packets have headers containing information such as the IP addresses of the sender and receiver
MP3 Each packet of data is sent independently to the destination // Packets don’t necessarily follow the same route
MP4 Each packet is sent via the most optimum path available
MP5 Packets don’t necessarily arrive in the order they were sent // Packets are reconstructed at the destination in the
correct order
MP6 Missing / damaged packets are re-sent
(a) A linked list of nodes is used to store an ordered list of integers. Each node consists of the data, a left pointer and a right pointer, for example:
Left pointer Data Right pointer
20
The linked list will be organised as a binary tree.
−1 is used to represent a null pointer.
Complete the binary tree, including null pointers, to show how the data will be organised after the following integers have been added:
6, 15, 41, 66
Root pointer
36
12 40
–1 3
[4]
(b) Describe what is meant by recursion.
…… [2]
(c) A binary tree is a suitable Abstract Data Type (ADT) that a designer can implement using recursive algorithms.
Identify one other ADT that a designer can implement using recursive algorithms.
…… [1]
Mark scheme
4(a) One mark per mark point 4
MP1 Any two nodes added correctly with correct data (6, 15, 41, 66) and arrows
MP2 Remaining two nodes added with correct data (6, 15, 41, 66) and all nodes with connecting arrows starting from
pointer boxes
MP3 Correct null pointers (-1) added throughout
MP4 … with no entries in other pointer boxes and all nodes correctly positioned and connected
Root pointer
Left pointer Data Right pointer
36
12 -1 40
-1 3 -1 15 -1 -1 41
-1 6 -1 -1 66 -1
4(b) One mark per mark point 2
MP1 A technique used to solve problems using a function/procedure/subroutine that calls itself (general case)
MP2 … until the terminating condition / base case is achieved, when no further recursive calls are made
4(c) One mark 1
• Stack
This truth table represents a logic circuit.
INPUT OUTPUT
A B C D Z
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 1
0 1 1 0 0
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 1
(a) Write the Boolean logic expression that corresponds to the given truth table as the sum-of-products.
Z = ……
…… [2]
(b) (i) Complete the Karnaugh map (K-map) for the given truth table.
AB
CD 00 01 11 10
00
01
11
10
[2]
(ii) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal sum-of-products. [2]
(iii) Write the Boolean logic expression from your answer to part (b)(ii) as the simplified sum-of-products.
Z = ……
…… [2]
Mark scheme
5(a) Two marks for all six correct terms 2
One mark for any three correct terms
Z = A.B.C.D + A.B.C.D + A.B.C.D + A.B.C.D + A.B.C.D + A.B.C.D
5(b)(i) Two marks if no errors present 2
One mark if one error present
AB
CD 00 01 11 10
00 1 0 0 1
01 0 1 1 0
11 0 1 1 0
10 0 0 0 0
5(b)(ii) One mark for each correct loop 2
AB
CD 00 01 11 10
00 1 0 0 1
01 0 1 1 0
11 0 1 1 0
10 0 0 0 0
5(b)(iii) One mark for each mark point 2
• One correct Boolean term
• Boolean terms and operator correct and no other terms present
Z = B.D + B.C.D // B.C.D + B.D
Describe the process of executing a program using an interpreter.
…… [4]
Mark scheme
6 One mark for each mark point (Max 4) 4
MP1 The interpreter translates the source code one line at a time
MP2 If the line is syntax error free it is executed
MP3 It is not stored in executable format
MP4 If an error is found, the program halts with an error message
MP5 Each line must be translated every time it is run, including lines running multiple times for example in loops
Several syntax diagrams are shown.
uppercase lowercase
A b
C d
E f
G h
J k
symbol digit
$ 0
@ 1
# 2
& 3
% 4
5
6
7
8
9 lowercase
passcode uppercase symbol
digit
(a) State why each passcode is invalid for the given syntax diagrams.
#Jd7
Reason ……
C%6A
Reason ……
[2]
(b) Complete the Backus-Naur Form (BNF) for <uppercase> and <passcode>.
<uppercase> ::= ……
<passcode> ::= ……
[4]
Mark scheme
7(a) One mark for each correct answer 2
#Jd7 – must begin with a member of the group uppercase // cannot begin with a symbol
C%6A – the fourth character cannot be a member of the group uppercase // the fourth character must be either a symbol,
digit or lowercase
7(b) One mark per mark point 4
<uppercase> ::= A | C | E | G | J
<passcode> ::= <uppercase><code>
<code> ::= <lowercase>|<symbol>|<digit>
|<lowercase><code>|<symbol><code>|<digit><code>
(a) Describe what is meant by multi-tasking and how it benefits process management.
…… [2]
(b) Explain the function of the shortest remaining time scheduling routine and give a benefit of this routine.
Function ……
Benefit ……
[4]
Mark scheme
8(a) One mark for each mark point 2
MP1 Running multiple processes concurrently
MP2 … which benefits process management by allowing more tasks to complete than would be the case if they had to
run one task after another.
8(b) One mark for each mark point (Max 3) 4
MP1 The processes are queued as they arrive
MP2 Processes with the shortest burst time are executed first
MP3 It is a pre-emptive scheduling function // When a process with a shorter burst time arrives the existing process is
replaced by the shorter process.
MP4 The scheduler will continue to choose shorter processes over longer processes if they continue to be added to the
queue can cause starvation for longer jobs
One mark for benefit (Max 1) e.g.
MP5 Processes with a short burst time are processed very quickly
MP6 Waiting time is minimised
Secure Socket Layer (SSL) and Transport Layer Security (TLS) are two protocols.
(a) State two functions of SSL/TLS.
1 ……
2 ……
[2]
(b) Give two examples of situations where the use of SSL/TLS would be appropriate.
1 ……
2 ……
[2]
Mark scheme
9(a) One mark for each mark point (Max 2) 2
MP1 Ensure security/privacy when using the internet
MP2 Data encryption
MP3 Identification / authentication of client and server
9(b) One mark for each mark point (Max 2) 2
MP1 When transmitting authentication data e.g. passwords, session cookies
MP2 When transmitting data that must be protected from modification on its way to or from a server e.g. user input, or
results from the server
MP3 When transmitting data classified as non-public.
(a) Describe the purpose of a graph when used in an Artificial Intelligence (AI) system.
…… [2]
(b) Explain the use of artificial neural networks in Deep Learning.
…… [4]
Mark scheme
10(a) One mark for each mark point (Max 2) 2
MP1 A graph is used in AI to record relationships between entities
MP2 … using vertices / nodes and edges
MP3 for example, to represent places on a map and the distances between them, in order to find the shortest route.
10(b) One mark for each mark point (Max 4) 4
MP1 Artificial neural networks are designed to work in the same way as the human brain
MP2 ANNs provide the architecture and algorithms for learning from the data
MP3 They have a large number of connected processing units / nodes
MP4 … that are arranged in layers / interconnected and work together to process data
MP5 Deep learning models learn from data by adjusting the weights/biases of the connections between neurons
MP6 They use multiple hidden layers to extract complex features and to make predictions
(a) A medical centre uses objects of the class Appointment to record treatments given and medication prescribed during each doctor’s appointment. Some of the attributes required in the class are listed in the table.
Attribute Data type Description
DateSeen DATE date of treatment
Treatments STRING treatments given
Medications STRING medications prescribed
Patients are identified by a unique 8-digit number, beginning with the patient’s year of birth, for example, 20108989.
Doctors are identified by their name, for example, A N Other.
Complete the class diagram for Appointment, to include:
• attribute and data type for the identification of the patient
• attribute and data type for the identification of the doctor
• methods to assign date seen, treatments given and medications prescribed
• method to return the date seen and the attributes for the patient and the doctor.
Appointment
DateSeen : DATE
…… : ……
…… : ……
Treatments : STRING
Medications : STRING
SetPatientID(PatientNumber : INTEGER)
SetDoctor(DoctorID : STRING)
GetTreatments()
GetMedications()
[5]
(b) (i) Identify the object-oriented programming (OOP) feature whose function includes restricting external access to the data.
…… [1]
(ii) Describe what is meant by the OOP feature inheritance.
…… [2]
Mark scheme
11(a) One mark per mark point 5
MP1 Two correct attributes (PatientID : INTEGER and Doctor : STRING)
MP2 SetTreatments(…) and SetMedications(…) seen
MP3 … and appropriate parameters, with string data types
MP4 GetPatientID() and GetDoctor() seen
MP5 SetDateSeen(…) and GetDateSeen fully correct with appropriate parameter and correct data type in setter.
Appointment
DateSeen : DATE
PatientID : INTEGER
Doctor : STRING
Treatments : STRING
Medications : STRING
SetDateSeen(NewDate : DATE)
SetPatientID(PatientNumber : INTEGER)
SetDoctor(DoctorID : STRING)
SetTreatments(NewTreatments : STRING)
SetMedications(NewMedications : STRING)
GetDateSeen()
GetPatientID()
GetDoctor()
GetTreatments()
GetMedications()
11(b)(i) Encapsulation 1
11(b)(ii) One mark for each mark point (Max 2) 2
MP1 Inheritance is where a derived class takes properties / behaviours attributes / methods
MP2 … of a parent / super class / base class
MP3 The attributes / methods / properties taken from the parent / super class / base class can also be extended /
copied / used / changed / overwritten / overridden in the subclass.
The pseudocode algorithm checks whether a location in a stock file StockList.dat is empty or not. The location is given by the user. If the location is empty, a suitable message is displayed, otherwise the item stored at that location is displayed.
Complete this file-handling pseudocode algorithm.
DECLARE Location : INTEGER
DECLARE Item : STRING
DECLARE Continue : BOOLEAN
DECLARE Answer : CHAR
Continue TRUE
OPENFILE ……
WHILE Continue
OUTPUT "Enter a location between 1 and 500: "
INPUT Location
GETRECORD ……
IF Item = "" THEN
OUTPUT "This record is missing."
ELSE
OUTPUT "The item in stock is ", ……
ENDIF
OUTPUT "Another location (Y or N)?"
INPUT Answer
IF Answer <> 'Y' THEN
Continue FALSE
ENDIF
ENDWHILE
OUTPUT "End of program"
[5]
Mark scheme
12 One mark for each correctly completed line (Max 5) 5
DECLARE Location : INTEGER
DECLARE Item : STRING
DECLARE Continue : BOOLEAN
DECLARE Answer : CHAR
Continue ← TRUE
OPENFILE "StockList.dat" FOR RANDOM
WHILE Continue
OUTPUT "Enter a location between 1 and 500: "
INPUT Location
SEEK "StockList.dat", Location
GETRECORD "StockList.dat", Item
IF Item = "" THEN
OUTPUT "This record is missing"
ELSE
OUTPUT "The item in stock is ", Item
ENDIF
OUTPUT "Another location (Y or N)?"
INPUT Answer
IF Answer <> 'Y' THEN
Continue ← FALSE
ENDIF
ENDWHILE
CLOSEFILE "StockList.dat"
OUTPUT "End of program"
Checked your answers against these? Let AI mark the whole paper, on your own working.
Examiners follow the generic marking principles at the front of the scheme, then each question's points: method (M), accuracy (A) and independent (B) marks, error carried forward where the scheme allows it, and positive marking, so you're credited for what you got right.
Check your answers against it
Done this paper? Upload your script and CIE Buddy's AI marker marks it question by question against this exact scheme, puts the ticks on your own working and says what each lost mark needed.
Where can I find the 9618/31 May/June 2025 mark scheme?+
On this page, free: the mark scheme for AS & A Level Computer Science 9618/31, May/June 2025 (9618_s25_ms_31), and the question paper (9618_s25_qp_31), to read or download, with each question's marking points written out underneath.
How many marks is 9618/31 out of?+
Computer Science 9618/31 for May/June 2025 is out of 75 marks, with 1 hour 30 minutes to answer it.
Can I get my 9618/31 answers marked?+
Yes. Upload your answers to 9618/31/M/J/25 as a PDF or photos, and CIE Buddy marks every question against this paper's official mark scheme, using Cambridge's marking rules. You get your score, each lost mark explained on your own script, and the topics to revise. It's a guide, not an official Cambridge grade.