Computer Science (9618) · May/June 2025 · Question paper 31

Cambridge Computer Science (9618) question paper for paper 31, May/June 2025 — 9618/31/M/J/25, file 9618_s25_qp_31.pdf.

Advertisement
Loading the paper…
Text of this paper

* 0000800000001 *

,

,

Cambridge International AS & A Level
¬OŠ. 4mHuOªEŠ]{5€W
¬Dn|Z¥¦’Sˆ‡;]DEq‚
¥E¥•55e5¥•¥ •EUUU

* 6 0 0 5 3 5 2 7 4 2 *

COMPUTER SCIENCE

9618/31

Paper 3 Advanced Theory

May/June 2025
1 hour 30 minutes

You must answer on the question paper.
No additional materials are needed.
INSTRUCTIONS
●
Answer all questions.
●
Use a black or dark blue pen.
●
Write your name, centre number and candidate number in the boxes at the top of the page.
●
Write your answer to each question in the space provided.
●
Do not use an erasable pen or correction fluid.
●
Do not write on any bar codes.
●
You may use an HB pencil for any diagrams, graphs or rough working.
●
Calculators must not be used in this paper.

INFORMATION
●
The total mark for this paper is 75.
●
The number of marks for each question or part question is shown in brackets [ ].
●
No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Any blank pages are indicated.
DC (DE/CT) 342251/3
© UCLES 2025

[Turn over

2
,

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

DO NOT WRITE IN THIS MARGIN

* 0000800000002 *

(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).

DO NOT WRITE IN THIS MARGIN

[2]

DO NOT WRITE IN THIS MARGIN

[4]

© UCLES 2025

ĬÍĊ®Ġ´íÈõÏĪÅĊàù·þ×
ĬÄðûÛġĢøìùñØĕºõÉĘĂ
ĥĕõĕõÕĥÕÕÕµÅąÕåĕõÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

* 0000800000003 *

3
,

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.

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

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

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

[4]

© UCLES 2025

ĬÏĊ®Ġ´íÈõÏĪÅĊàû·þ×
ĬÄïüÓħĞĈÍÿĀđÁÂáÉĨĂ
ĥĕąÕµµąµÅåĥÅąµÅÕĥÕ

9618/31/M/J/25

[Turn over

4
,

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

DO NOT WRITE IN THIS MARGIN

* 0000800000004 *

Purpose of Transport Layer

DO NOT WRITE IN THIS MARGIN

[5]
(b) Describe packet switching as a method of transmitting messages across the internet.

DO NOT WRITE IN THIS MARGIN

[4]

© UCLES 2025

ĬÍĊ®Ġ´íÈõÏĪÅĊÞù·Ā×
ĬÄïùÓĝĐāêāćĚģĞăÙĐĂ
ĥåÕÕõµąĕåąĕÅŵĥÕõÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

* 0000800000005 *

5
,

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

−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

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

The linked list will be organised as a binary tree.

36

12

3

DO NOT WRITE IN THIS MARGIN

–1

40

DO NOT WRITE IN THIS MARGIN

[4]
(b) Describe what is meant by recursion.

[2]
© UCLES 2025

ĬÏĊ®Ġ´íÈõÏĪÅĊÞû·Ā×
ĬÄðúÛīĔñÏ÷úÏ·Ė×ÙĠĂ
ĥååĕµÕĥõµõÅÅÅÕąĕĥÕ

9618/31/M/J/25

[Turn over

6
,

,

(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]

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]

© UCLES 2025

ĬÑĊ®Ġ´íÈõÏĪÅĊßû¶þ×
ĬÄïúØġüû×ôċæ×жñĐĂ
ĥõąĕµõĥÕõĕĥÅąÕåÕµÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

OUTPUT

DO NOT WRITE IN THIS MARGIN

INPUT

DO NOT WRITE IN THIS MARGIN

This truth table represents a logic circuit.

DO NOT WRITE IN THIS MARGIN

5

DO NOT WRITE IN THIS MARGIN

* 0000800000006 *

DO NOT WRITE IN THIS MARGIN

* 0000800000007 *

7
,

(b) (i)

,

Complete the Karnaugh map (K-map) for the given truth table.
AB
00

CD

01

11

10

00

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

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]

6

Describe the process of executing a program using an interpreter.

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

[4]

© UCLES 2025

ĬÓĊ®Ġ´íÈõÏĪÅĊßù¶þ×
ĬÄðùÐħøċâĆöģăĖĢñĠĂ
ĥõõÕõĕąµĥĥµÅąµÅĕåÕ

9618/31/M/J/25

[Turn over

uppercase

symbol

lowercase

A

b

C

d

E

f

G

h

J

k

digit

$

0

@

1

#

2

&

3

%

4
5
6
7
8

lowercase
passcode

uppercase

symbol
digit

© UCLES 2025

ĬÑĊ®Ġ´íÈõÏĪÅĊÝû¶Ā×
ĬÄðüÐĝĆþÕČíĬáºÄġĘĂ
ĥÅåÕµĕąĕąÅÅÅŵĥĕµÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

Several syntax diagrams are shown.

DO NOT WRITE IN THIS MARGIN

,

9
DO NOT WRITE IN THIS MARGIN

7



DO NOT WRITE IN THIS MARGIN

8
,

DO NOT WRITE IN THIS MARGIN

* 0000800000008 *

DO NOT WRITE IN THIS MARGIN

* 0000800000009 *

9
,



,

(a) State why each passcode is invalid for the given syntax diagrams.

#Jd7
Reason

DO NOT WRITE IN THIS MARGIN

C%6A
Reason

[2]
(b) Complete the Backus-Naur Form (BNF) for <uppercase> and <passcode>.
<uppercase> ::=

[4]

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

<passcode> ::=

© UCLES 2025

ĬÓĊ®Ġ´íÈõÏĪÅĊÝù¶Ā×
ĬÄïûØīĊîäîĄÝõÂĘġĨĂ
ĥÅÕĕõõĥõĕµĕÅÅÕąÕåÕ

9618/31/M/J/25

[Turn over

10
,

8

,

(a) Describe what is meant by multi-tasking and how it benefits process management.

DO NOT WRITE IN THIS MARGIN

* 0000800000010 *

[2]
(b) Explain the function of the shortest remaining time scheduling routine and give a benefit of
this routine.
Function

DO NOT WRITE IN THIS MARGIN

Benefit

[4]
Secure Socket Layer (SSL) and Transport Layer Security (TLS) are two protocols.
(a) State two functions of SSL/TLS.
1

2

[2]

DO NOT WRITE IN THIS MARGIN

9

DO NOT WRITE IN THIS MARGIN

1

2

[2]
© UCLES 2025

ĬÑĊ®Ġ´íÈõÏĪÅĊàû¸þ×
ĬÄíüÕğþĜÛăö½¼èÙĠĂ
ĥĕÅĕµĕåĕåõÅąÅĕĥĕąÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

(b) Give two examples of situations where the use of SSL/TLS would be appropriate.

DO NOT WRITE IN THIS MARGIN

* 0000800000011 *

11
,

,

10 (a) Describe the purpose of a graph when used in an Artificial Intelligence (AI) system.

DO NOT WRITE IN THIS MARGIN

[2]
(b) Explain the use of artificial neural networks in Deep Learning.

[4]

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

© UCLES 2025

ĬÓĊ®Ġ´íÈõÏĪÅĊàù¸þ×
ĬÄîûÍĩĂĬÞõċćęÄôÙĐĂ
ĥĕµÕõõÅõµąĕąÅõąÕĕÕ

9618/31/M/J/25

[Turn over

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.

DateSeen

DO NOT WRITE IN THIS MARGIN

Appointment
: DATE

:
:
Treatments

: STRING

Medications

: STRING

DO NOT WRITE IN THIS MARGIN

12
,

DO NOT WRITE IN THIS MARGIN

* 0000800000012 *

DO NOT WRITE IN THIS MARGIN

SetPatientID(PatientNumber : INTEGER)
SetDoctor(DoctorID : STRING)

GetTreatments()
GetMedications()
[5]
© UCLES 2025

ĬÑĊ®Ġ´íÈõÏĪÅĊÞû¸Ā×
ĬÄîúÍģôĝÙûĄĀ»ĠÒÉĨĂ
ĥåĥÕµõÅÕÕåĥąąõåÕąÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

* 0000800000013 *

13
,

(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.

DO NOT WRITE IN THIS MARGIN

[2]
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.

DO NOT WRITE IN THIS MARGIN

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

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

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]

© UCLES 2025

ĬÓĊ®Ġ´íÈõÏĪÅĊÞù¸Ā×
ĬÄíùÕĥðčàýíÉğĘĆÉĘĂ
ĥåĕĕõĕåµÅÕµąąĕÅĕĕÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

,

© UCLES 2025

14

BLANK PAGE

ĬÍĊ®Ġ´íÈõÏĪÅĊÝúµĂ×
ĬÄîûØīăĥÎċúĦýĂùĐĂ
ĥąĕÕµõĥĕåŵÅÅÕĥÕÅÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

,

DO NOT WRITE IN THIS MARGIN

* 0000800000014 *

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

* 0000800000015 *

,

© UCLES 2025
,

15

BLANK PAGE

ĬÏĊ®Ġ´íÈõÏĪÅĊÝüµĂ×
ĬÄíüÐĝÿĕëíćãėµÖùĠĂ
ĥąĥĕõĕąõµµĥÅŵąĕÕÕ

9618/31/M/J/25

16
,

,

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
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
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

© UCLES 2025

ĬÍĊ®Ġ´íÈõÏĪÅĊßúµĄ×
ĬÄíùÐħíĔÐóĀìµęøĩĘĂ
ĥµµĕµĕąÕÕĕĕÅąµåĕÅÕ

9618/31/M/J/25

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

DO NOT WRITE IN THIS MARGIN

BLANK PAGE

DO NOT WRITE IN THIS MARGIN

* 0000800000016 *

Advertisement