9618/31

Computer Science 9618/31May/June 2025

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

12
questions
75
marks
90
minutes

Topics Data Representation · System Software · Communication and Internet Technologies · Computational Thinking and Problem-solving · Hardware and Virtual Machines · Security · +2 more

Q1Medium-EasyData Representation

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

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

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

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

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

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

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

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

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

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

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

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

4M
Q2MediumData Representation

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

2M
(b)

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

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

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

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

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

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

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

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

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

4M
Q3Medium-EasyCommunication and Internet Technologies
(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 ......................................................................................................

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

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

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

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

5M
(b)

Describe packet switching as a method of transmitting messages across the internet.

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

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

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

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

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

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

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

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

4M
Q4MediumComputational Thinking and Problem-solving
(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:

The linked list will be organised as a binary tree.

1-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

4M
(b)

Describe what is meant by recursion.

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

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

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

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

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

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

1M
Q5MediumHardware and Virtual Machines

This truth table represents a logic circuit.

INPUTOUTPUT
ABCDZ
00001
00010
00100
00110
01000
01011
01100
01111
10001
10010
10100
10110
11000
11011
11100
11111
(a)

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

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

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

2M
(b)
6M
(i)

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

2M
(ii)

Draw loop(s) around appropriate group(s) in the K-map to produce an optimal sum-of-products.

2M
(iii)

Write the Boolean logic expression from your answer to part (b)(ii) as the simplified sum-of-products.

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

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

2M
Q64MMedium-EasySystem Software

Describe the process of executing a program using an interpreter.

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

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

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

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

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

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

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

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

Similar questions
Q7MediumSystem Software

Several syntax diagrams are shown.

(a)

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

#Jd7

Reason .....................................................................................................................................

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

C%6A

Reason .....................................................................................................................................

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

2M
(b)

Complete the Backus-Naur Form (BNF) for <uppercase> and <passcode>.

<uppercase> ::= .................................................................................................................

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

<passcode> ::= ...................................................................................................................

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

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

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

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

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

4M
Q8MediumSystem Software
(a)

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

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

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

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

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

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

2M
(b)

Explain the function of the shortest remaining time scheduling routine and give a benefit of this routine.

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

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

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

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

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

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

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

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

4M
Q9EasySecurity

Secure Socket Layer (SSL) and Transport Layer Security (TLS) are two protocols.

(a)

State two functions of SSL/TLS.

1 ................................................................................................................................................

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

2 ................................................................................................................................................

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

2M
(b)

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

1 ................................................................................................................................................

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

2 ................................................................................................................................................

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

2M
Q10MediumArtificial Intelligence (AI)
(a)

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

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

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

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

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

2M
(b)

Explain the use of artificial neural networks in Deep Learning.

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

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

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

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

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

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

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

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

4M
Q11MediumFurther Programming

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.

AttributeData typeDescription
DateSeenDATEdate of treatment
TreatmentsSTRINGtreatments given
MedicationsSTRINGmedications 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.

(a)

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()                                                         |
+--------------------------------------------------------------------------+
5M
(b)
3M
(i)

Identify the object-oriented programming (OOP) feature whose function includes restricting external access to the data.

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

1M
(ii)

Describe what is meant by the OOP feature inheritance.

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

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

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

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

2M
Q125MMediumData Representation

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"
Similar questions