9618/32

Computer Science 9618/32May/June 2025

Cambridge A-Level · Advanced Theory · worked solutions for every part, with the mark scheme

13
questions
75
marks
90
minutes

Topics Data Representation · System Software · Communication and Internet Technologies · Artificial Intelligence (AI) · Hardware and Virtual Machines · Security · +2 more

Q1Medium-EasyData Representation

Data types can be defined using pseudocode.

The composite record data type, Departure, is used to represent flights from Cambridge Airport and is defined in pseudocode as:

TYPE Departure
  DECLARE FlightNumber : STRING
  DECLARE Destination : STRING
  DECLARE FlightDate : DATE
  DECLARE Gate : STRING
  DECLARE Airline : STRING
ENDTYPE

A variable, Flight1, is declared in pseudocode as:

DECLARE Flight1 : Departure
(a)

Write pseudocode to store the following details to Flight1:

FieldData
FlightNumberSB2789
DestinationDublin
FlightDate30/07/2025
GateN03
AirlineCambridge Airways

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

3M
(b)

The data type for Gate is changed to an enumerated data type, GateID.

3M
(i)

Write a pseudocode statement to declare GateID to hold the identity codes for the airport gates:

N01, N02, N03, W01, W02, W03, W04

...........................................................................................................................................

.....................................................................................................................................

2M
(ii)

Write the new pseudocode statement required to replace the declaration of Gate in Departure.

.....................................................................................................................................

1M
Q2MediumData Representation

Numbers are stored in a computer using binary floating-point representation with:
• 12 bits for the mantissa
• 4 bits for the exponent
• two’s complement form for both the mantissa and the exponent.

(a)

Calculate the normalised binary floating-point representation of +124.4375 in this system.
Show your working.

Working .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

3M
(b)

Calculate the denary value of the following normalised binary floating-point number.
Show your working.

Working .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Denary value ............................................................................................................................

3M
Q3Medium-EasyCommunication and Internet Technologies
(a)

Identify two different layers of the TCP/IP protocol suite.

...................................................................................................................................................

.............................................................................................................................................

1M
(b)

Describe how the TCP/IP protocol suite is applied when a message is sent through the internet from one host to another. Do not describe the function of individual layers of the TCP/IP protocol suite.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

4M
Q44MMedium-EasyCommunication and Internet Technologies

Circuit switching may be used as a method of data transmission.

State two benefits and two drawbacks of circuit switching.

Benefit 1 ...........................................................................................................................................

..........................................................................................................................................................

Benefit 2 ...........................................................................................................................................

..........................................................................................................................................................

Drawback 1 ......................................................................................................................................

..........................................................................................................................................................

Drawback 2 ......................................................................................................................................

..........................................................................................................................................................

Similar questions
Q5Medium-EasySystem Software

The management and scheduling of processes are tasks carried out by an operating system.

(a)

Identify three process states.

1 ................................................................................................................................................
2 ................................................................................................................................................
3 ................................................................................................................................................

3M
(b)

Describe the function of the shortest job first scheduling routine and give a benefit of this routine.

Function ....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Benefit ......................................................................................................................................

...................................................................................................................................................

4M
Q6Medium-EasyArtificial Intelligence (AI)
(a)

Describe the structure of a graph as used in an Artificial Intelligence (AI) system.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

2M
(b)

Explain how supervised learning and unsupervised learning differ from each other.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

4M
Q7Medium-HardHardware and Virtual Machines

The diagram shows a logic circuit.

(a)

Complete the truth table for the given logic circuit.
Show your working.

Working space
ABCDPQRSZ
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
3M
(b)

Write the Boolean logic expression that corresponds to the given logic circuit as the sum-of-products.

Z = ............................................................................................................................................

.............................................................................................................................................

1M
(c)

Use Boolean algebra including De Morgan’s laws to simplify the following expression.
Show all working.

(A+B)(AB+BC)(\overline{A + B}) \cdot (\overline{A \cdot B + B \cdot C})

Working .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Simplified expression ................................................................................................................

...................................................................................................................................................

4M
Q84MMedium-EasySystem Software

Explain what is meant by lexical analysis during program compilation.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

....................................................................................................................................................

Similar questions
Q9MediumSystem Software

Several syntax diagrams are shown.

(a)

State why 9K is not a valid variable for the given syntax diagrams.

...................................................................................................................................................

.............................................................................................................................................

1M
(b)

Complete the Backus-Naur Form (BNF) for <operator>.

<operator> ::= ..................................................................................................................

.............................................................................................................................................

1M
(c)

An expression is defined as follows:
• A variable is assigned to a variable followed by an operator followed by another variable.
• The operator and final variable stage can be repeated as many times as necessary.

Complete the syntax diagram for an expression.

3M
(d)

A character can be a letter or a digit.

An additional constraint has been applied to the definition of variable. It must comply with the given syntax diagram, but it will only pass validation if it has at least four characters.

State one example of a valid variable.

...................................................................................................................................................

.............................................................................................................................................

1M
Q104MMedium-EasySecurity

Identify the two main protocols that form Transport Layer Security (TLS) and state the purpose of each.

Protocol 1 .........................................................................................................................................

Purpose ............................................................................................................................................

..........................................................................................................................................................

Protocol 2 .........................................................................................................................................

Purpose ............................................................................................................................................

..........................................................................................................................................................

Similar questions
Q11MediumComputational Thinking and Problem-solving
(a)

A linked list of nodes is used to store an ordered list of strings. Each node consists of the data, a left pointer and a right pointer.

The linked list will be organised as a binary tree.

0 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 strings have been added:

Aa, Mm, Ss, Xx

4M
(b)

A binary tree can be used to implement recursion.

Identify one feature of an algorithm that makes it beneficial to use recursion.
Give one example of an application that could use a recursive algorithm.

Feature .....................................................................................................................................

...................................................................................................................................................

Example ....................................................................................................................................

2M
Q12MediumFurther Programming
(a)

A medical clinic uses objects of the class Patient to assign a priority and a doctor to a patient. Some of the attributes required in the class are listed in the table.

AttributeData typeDescription
PatientIDSTRINGUnique identifier of the patient
NameSTRINGPatient’s full name, surname first
DoctorIDSTRINGID of doctor administering treatment

Treatment is prioritised with a numeric scale of 1 to 5.

Complete the class diagram for Patient, to include:
• attribute and data type for the date of birth
• attribute and data type for the priority
• methods to assign the patient ID, priority and doctor ID
• methods to return the patient ID, patient date of birth and the priority.

5M
(b)
3M
(i)

Identify the object-oriented programming (OOP) term described as ‘an occurrence of an object’.

.....................................................................................................................................

1M
(ii)

Describe what is meant by the OOP term polymorphism.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.....................................................................................................................................

2M
Q135MMedium-EasyData Representation

The pseudocode algorithm below uses random file access to copy 50 records from a live file CurrentResults.dat to a stored file StoredResults.dat one record at a time. It uses the user-defined type StudentResult.

TYPE StudentResult
  DECLARE LastName : STRING
  DECLARE FirstName : STRING
  DECLARE ExamGrade : STRING
ENDTYPE

If any grades are missing in CurrentResults.dat, the text "Missing grade" is added to the ExamGrade field in StoredResults.dat

Complete this file handling pseudocode algorithm.

DECLARE Grade : StudentResult
DECLARE Position : INTEGER

..........................................................................................................................

OPENFILE "StoredResults.dat" FOR RANDOM

..........................................................................................................................

FOR Position ← 1 TO 50
  SEEK "CurrentResults.dat", Position
  GETRECORD "CurrentResults.dat", Grade
  IF Grade.ExamGrade = "" THEN
    .............................................................................................................
  ENDIF 
  ....................................................................................................................
  ....................................................................................................................
NEXT Position
CLOSEFILE "CurrentResults.dat"
CLOSEFILE "StoredResults.dat"
Similar questions