Cambridge A Level Computer Science 9618 — 2022 May/June Paper 3 · Variant 1
9618/31/M/J/22 · 9 questions · 75 marks · ≈84 min
The question paper and its mark scheme, free to read here and free to download. This is Cambridge’s own paper, exactly as it was sat.
Question paper16 pages
















Mark scheme11 pages
Answers below. Sit the paper first if you are practising.











Questions as text
Q1 · Data types can be defined using pseudocode
1 Data types can be defined using pseudocode. The data type, LibraryRecord, is defined in pseudocode as: TYPE LibraryRecord DECLARE Title : STRING DECLARE Fiction : BOOLEAN DECLARE Author : STRING DECLARE NumberOfCopies : INTEGER ENDTYPE A variable, LibraryBook, is declared in pseudocode as: DECLARE LibraryBook : LibraryRecord (a) Write pseudocode statements to assign: • A Level Computer Science to Title of LibraryBook • FALSE to Fiction of LibraryBook. ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ............................................................................................................................................. [2] (b) The type definition for LibraryRecord is changed. (i) The value for NumberOfCopies must be between 1 and 10 inclusive. Write the updated line of pseudocode from the type definition of LibraryRecord to implement the change. ........................................................................................................................................... ..................................................................................................................................... [1] (ii) Every copy of every book is now uniquely identified by an accession number, AccessionNumber, as it is added to the library. Each library record will include one or more accession numbers. Each accession number is an integer. Write the extra line of pseudocode needed in the type definition of LibraryRecord. ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ..................................................................................................................................... [2] (c) A record is a user-defined composite data type. Explain what is meant by a user-defined composite data type. Include an example of another user-defined composite data type in your answer. ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... [3]
Mark scheme: 1(a) LibraryBook.Fiction FALSE 1(b)(i) DECLARE NumberOfCopies : 1 .. 10 1 1(b)(ii) DECLARE AccessionNumber : ARRAY[1:NumberOfCopies] OF INTEGER 2 1(c) Any two from A data type constructed by a programmer // not a primitive data type A data type that references at least one other data type… … the data types can be primitive, or user defined One mark for an example Class / object / set 3
Q2 · A declarative language is used to represent the following facts about cats
2 A declarative language is used to represent the following facts about cats. 01 type(leopard, wild). 02 type(lion, wild). 03 type(cheetah, wild). 04 type(savannah, hybrid). 05 type(persian, domestic). 06 07 hair(leopard, medium). 08 hair(lion, short). 09 hair(cheetah, medium). 10 hair(savannah, medium). 11 hair(persian, long). 12 13 spots(leopard, yes). 14 spots(lion, no). 15 spots(cheetah, yes). 16 spots(savannah, yes). 17 spots(persian, no). These clauses have the following meaning: Clause Meaning 01 A leopard is a type of wild cat. 08 A lion has short hair. 16 A savannah has spots. (a) More facts are to be included. A caracal is a wild cat with short hair. Write the additional clauses to record these facts. 18 ............................................................................................................................................. 19 ............................................................................................................................................. [2] (b) Using the variable Cat, the goal: hair(Cat, medium) returns Cat = leopard, cheetah, savannah Write the result returned by the goal: hair(Cat, long) Cat = ................................................................................................................................. [1] (c) (i) Write the goal, using the variable Pet, to find all the domestic cats. ........................................................................................................................................... ..................................................................................................................................... [1] (ii) Write the goal, using the variable WildSpotty, to find all the wild cats with spots. ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ..................................................................................................................................... [2]
Mark scheme: 2(a) hair(caracal, short). 2 2(b) persian 1 2(c)(i) type(Pet, domestic). 1 2(c)(ii) spots(WildSpotty, yes) ,type(WildSpotty, wild). 2
Q3 · Data can be sent over networks using either circuit switching or packet switching
3 Data can be sent over networks using either circuit switching or packet switching. Describe both methods of data transmission. Include a different advantage and disadvantage for each method. Circuit switching ............................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... Advantage ........................................................................................................................................ .......................................................................................................................................................... Disadvantage ................................................................................................................................... .......................................................................................................................................................... Packet switching .............................................................................................................................. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... Advantage ........................................................................................................................................ .......................................................................................................................................................... Disadvantage ................................................................................................................................... .......................................................................................................................................................... [8]
Mark scheme: 3 Circuit switching max four marks Any two from a dedicated circuit circuit is established before transmission starts // circuit is released after transmission ends data is transferred using the whole bandwidth all data is transferred over the same route Two from Advantage – data /frames arrive in order and do not need to be reassembled Disadvantage – nobody else can use the same circuit even if it is idle //less secure as only one route used Packet switching max four marks Any two from data is split into packets each packet is given its own route the routing for a packet depends on the congestion packets may not arrive in the order sent Two from Advantage – packets can be rerouted if there are problems// more secure as harder to intercept messages Disadvantage – time taken to reassemble packets at the destination
Q4 · Reduced Instruction Set Computers (RISC) and Complex Instruction Set Computers (CISC) are…
4 Reduced Instruction Set Computers (RISC) and Complex Instruction Set Computers (CISC) are two types of processor. (a) Describe what is meant by RISC and CISC processors. RISC ......................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... CISC ......................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... [4] (b) Identify two differences between RISC and CISC processors. 1 ................................................................................................................................................ ................................................................................................................................................... ................................................................................................................................................... 2 ................................................................................................................................................ ................................................................................................................................................... ................................................................................................................................................... [2]
Mark scheme: 4(a) RISC max 2 any two from: Uses simple instructions Uses fixed length instructions Instructions only require one clock cycle Uses many registers Makes use of pipelining Hardwired CU CISC max 2 any two from: Uses many instruction formats Uses variable length instructions Makes use of different addressing modes Uses few registers Has a large instruction set Requires complex circuits Frequently uses cache Instructions (converted to sub-instructions that) may require many clock cycles Programmable CU 4 4(b) One mark for each difference max 2 from: RISC has fewer instructions // CISC has more instructions RISC has many registers // CISC has few registers RISC’s instructions are simpler // CISC’s instructions are more complex RISC has a few instruction formats / CISC has many instruction formats RISC usually uses single-cycle instructions// CISC uses multi-cycle instructions RISC uses fixed-length instructions // CISC uses variable-length instructions RISC has better pipelineability // CISC has poorer pipelineability RISC requires less complex circuits// CISC requires more complex circuits RISC has fewer addressing modes // CISC has more addressing modes RISC makes more use of RAM// CISC makes more use of cache/less use of RAM RISC has a hard-wired control unit // CISC has a programmable control unit RISC only uses load and store instructions to address memory // CISC has many types of instructions to address memory 2
Q5 · Part of a program’s calculations uses the integer variables j, k, m, n and p
5 Part of a program’s calculations uses the integer variables j, k, m, n and p. j = 3 k = 2 m = 10 n = (j + k)/(j - k) p = m * (m - j * k) (a) Write the Reverse Polish Notation (RPN) for the expression: (j + k)/(j - k) ............................................................................................................................................. [2] (b) (i) Show the changing contents of the stack as the value for p is calculated from its RPN expression: m m j k * - * [4] (ii) Describe the main steps in the evaluation of this RPN expression using a stack. ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ..................................................................................................................................... [4] (c) State two other uses of a stack. 1 ................................................................................................................................................ ................................................................................................................................................... 2 ................................................................................................................................................ ................................................................................................................................................... [2]
Mark scheme: 5(a) One mark for each in order jk+jk-/ jk+ jk-/ 5(b)(i) 1 mark per ring Do not allow operators in stacks 2 3 3 6 10 10 10 10 4 10 10 10 10 10 10 40 4 5(b)(ii) Any four from Max 4 Max 3 generic answer only Working from left to right in the expression PUSH 10/m onto the stack PUSH the following numbers (10/m, 3/j, 2/k) onto the stack When the first operator ,*, is reached … POP the top two numbers, 2/k and 3/j … apply the operation PUSH result back onto stack Continue to the end of the expression 4 5(c) Any two from recursion implementation of ADTs e.g. linked lists procedure calls interrupt handling (storing contents of registers etc) 2
Q6 · A virtual machine is used to emulate a new computer system
6 A virtual machine is used to emulate a new computer system. Describe two benefits and one limitation of using a virtual machine for this purpose. Benefit 1 ........................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... Benefit 2 ........................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... Limitation .......................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... [6]
Mark scheme: 6 Two marks each benefit description max 4 New system can be tried on different virtual hardware (1) without need to purchase the hardware (1) Easier to recover if software emulating the new computer causes system crash (1) as VM provides protection to other software (1) Emulate programs for the new computer system that are not compatible with the host computer / operating system (1) by using the guest operating system on the old computer (1) More than one new computer system can be emulated (1) this allows multiple operating systems to coexist on a single computer(1) Two marks each limitation description max 2 from: Virtual machines may not be able to emulate the new hardware (1) because this hardware may have been developed since the virtual machine was developed (1) Using virtual machine means execution of extra code // A virtual machine might not be as efficient // resources e.g. memory or processor time are shared (1) processing time increased // performance degrades (1) Use of a virtual machine increases the maintenance overheads (1) because both host system and the virtual machine must be maintained (1)
Q7 · A program is to be written using Object-Oriented Programming (OOP) for a shop that sells…
7 A program is to be written using Object-Oriented Programming (OOP) for a shop that sells knitting yarn. There are three types of yarn: acrylic, wool or mix. The following data are stored for each type. • Name • Colour • Batch code • Weight • Number of balls of yarn in stock (can be edited) • Type of yarn The following statements apply to yarn. • Acrylic can be soft or not soft. • Wool can be lamb, merino or alpaca. • Mix contains a percentage of acrylic. Each type of yarn has a method that will display all the information about the yarn. (a) Complete this class inheritance diagram to show the properties, methods and inheritance. Yarn Name: STRING Colour: STRING BatchCode: STRING Weight: INTEGER NumberBalls: INTEGER Type: STRING Constructor() EditNumberBalls() YarnInfo() Acrylic Wool Mix Percentage: INTEGER .......................................... .......................................... Constructor() YarnInfo() Constructor() Constructor() .......................................... .......................................... [5] (b) Describe what is meant by the terms properties, methods and inheritance. Properties ................................................................................................................................. ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... Methods .................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... Inheritance ................................................................................................................................ ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... [6]
Mark scheme: 7(a) Acrylic has attribute Soft of type BOOLEAN Wool has attribute WoolType with suitable data type Acrylic and Wool have method YarnInfo() Acrylic, Wool and Mix at least one inherit (one arrow correct) from Yarn … … Acrylic, Wool and Mix all inherit (all arrows correct) from Yarn Yarn Name: STRING Colour: STRING BatchCode: STRING Weight: INTEGER NumberBalls: INTEGER Type: STRING Constructor() EditNumberBalls() YarnInfo() Mix Percentage: INTEGER Constructor() YarnInfo() Acrylic Soft: BOOLEAN Constructor() YarnInfo() Wool WoolType: STRING Constructor() YarnInfo() Question Answer Marks 7(b) Properties max 2: the data items / attributes the data types // characteristics defined in a class Methods max 2: the procedures/ functions / programmed instructions in a class / super class / base class … implementing the behaviours … that act on the properties / attributes Inheritance max 2: Methods and properties / attributes contained in one class/ super class / base class Are made available to / reused by another class/ derived class 6
Q8 · A message is to be sent securely
8 A message is to be sent securely. Software uses a key to encrypt the message before it is sent. (a) (i) Give two reasons for using key cryptography. 1 ........................................................................................................................................ ........................................................................................................................................... 2 ........................................................................................................................................ ........................................................................................................................................... [2] (ii) Give two methods of key cryptography that can be used. 1 ........................................................................................................................................ 2 ........................................................................................................................................ [2] (b) When there is a secure exchange of key(s), the message is sent. The use of quantum cryptography is being considered for the secure exchange. (i) State two possible benefits of using quantum cryptography. 1 ........................................................................................................................................ ........................................................................................................................................... ........................................................................................................................................... 2 ........................................................................................................................................ ........................................................................................................................................... ........................................................................................................................................... [2] (ii) State two possible drawbacks of using quantum cryptography. 1 ........................................................................................................................................ ........................................................................................................................................... ........................................................................................................................................... 2 ........................................................................................................................................ ........................................................................................................................................... ........................................................................................................................................... [2]
Mark scheme: 8(a)(i) Any two from To ensure the message is authentic // came from a trusted source To ensure that only the intended receiver is able to understand the message To ensure the message has not been altered during transmission Non-repudiation, neither the sender or receiver can deny the transmission occurred 8(a)(ii) Symmetric Asymmetric 2 8(b)(i) Any two from Any eavesdropping can be identified (as the state will be changed) Integrity of the key once transferred can be guaranteed (cannot be copied and decrypted at a later date) Longer/more secure keys can be exchanged 2 8(b)(ii) Any two from Limited range requires dedicated fibre (optic) line and specialist hardware cost of dedicated fibre (optic) line and specialist hardware is expensive polarisation of light may be altered whilst travelling down fibre optic cables 2
Q9 · The table shows assembly language instructions for a processor that has one general…
9 The table shows assembly language instructions for a processor that has one general purpose register, the Accumulator (ACC). Instruction Explanation Label Opcode Operand LDM #n Load the number n to ACC LDD <address> Load the contents of the given address to ACC The address to be used is at the given address LDI <address> Load the contents of this second address to ACC ADD <address> Add the contents of the given address to the ACC STO <address> Store the contents of the ACC at the given address Gives a symbolic address <label> to the memory <label>: <data> location with the contents <data> <label> can be used in place of <address> # denotes a denary number, e.g. #123 (a) The address 500 contains the value 100 and the address 100 contains the value 20. State the addressing mode and the contents of ACC after each instruction has been executed. LDM #500 Addressing mode ............................................................................................... Contents of ACC ................................................................................................. LDD 500 Addressing mode ............................................................................................... Contents of ACC ................................................................................................. LDI 500 Addressing mode ................................................................................................ Contents of ACC ................................................................................................. [3] (b) Use only the given instruction set to write assembly language code to: • use the constant 20 which needs to be stored • add this constant to the value stored in the address contained in the variable Y • store the result in variable Z. Instruction Label Opcode Operand [7]
Mark scheme: 9(a) LDM #500: Immediate 500 LDD 500: Direct 100 LDI 500: Indirect 20 9(b) Instruction Label Opcode Operand LDM #20 STO Twenty LDI Y ADD Twenty STO Z Twenty: #20 Y: Z: One mark for LDM #20 seen One mark for storing 20 at any address One mark for labelling that address e.g. Twenty away from the program code One mark for labelling addresses away from the program code as Y and Z One mark for correct use of LDI Y One mark for correct use of STO Z One mark for correct use of ADD with labelled address 7
What was in this paper
The subtopics covered by these 9 questions, and how many questions each got. Open one in a new tab to see every Cambridge question on it.
What you needed in this session
Cambridge’s own grade thresholds for 2022 May/June, Paper 3 · Variant 1. A higher threshold means an easier paper — the bar moves with how the cohort did.