Past paper – A Level Computer Science (9618)
Cambridge International AS & A Level · 9618
Computer Science · Paper 31
May/June 2025 · 9618/31/M/J/25
Answer on paper, open each mark scheme and give yourself marks, then open the Summary.
Question text
1
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).
…
…
…
…
…
…
…
… [4]
ĬÍĊ®Ġ´íÈõÏĪÅĊàù·þ×
Question text
2
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]
ĬÏĊ®Ġ´íÈõÏĪÅĊàû·þ×
Question text
3
(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]
ĬÍĊ®Ġ´íÈõÏĪÅĊÞù·Ā×
Question text
4
(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]
Question text
5
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
01
11
10
00
CD
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]
Question text
6
Describe the process of executing a program using an interpreter.
…
…
…
…
…
…
…
… [4]
ĬÓĊ®Ġ´íÈõÏĪÅĊßù¶þ×
Question text
7
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]
ĬÓĊ®Ġ´íÈõÏĪÅĊÝù¶Ā×
Question text
8
(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]
Question text
9
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]
ĬÑĊ®Ġ´íÈõÏĪÅĊàû¸þ×
Question text
10 (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]
ĬÓĊ®Ġ´íÈõÏĪÅĊàù¸þ×
Question text
11
(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]
Question text
12 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
TRUE
Continue
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
FALSE
Continue
ENDIF
ENDWHILE
…
OUTPUT "End of program"
[5]
ĬÓĊ®Ġ´íÈõÏĪÅĊÞù¸Ā×
,
,
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
ĬÍĊ®Ġ´íÈõÏĪÅĊßúµĄ×