Past paper – A Level Computer Science (old syllabus, to 2021) (9608)
Cambridge International AS & A Level · 9608
Computer Science (old syllabus, to 2021) · Paper 33
Oct/Nov 2021 · 9608/33/O/N/21
Answer on paper, open each mark scheme and give yourself marks, then open the Summary.
Question text
1
Data types can be defined using pseudocode.
The data type, ComputerRecord, is defined by the following pseudocode:
TYPE ComputerRecord
DECLARE ComputerID
: INTEGER
DECLARE ComputerType
: (Laptop, Desktop, Tablet)
DECLARE ComputerLocation : (Lab1, Lab2, Lab3, Mobile)
DECLARE DateTested
: DATE
ENDTYPE
A variable, SchoolComputer, is declared in pseudocode as:
DECLARE SchoolComputer : ComputerRecord
(a) Write pseudocode statements to assign 1234 to the ComputerID of SchoolComputer
and Lab2 to the ComputerLocation of SchoolComputer.
…
… [2]
(b) The type definition for ComputerRecord is changed.
(i)
The definition has been extended to include the student identification numbers,
StudentID, for up to 20 students who can use that computer. Each student identification
number is an integer.
Write the extra line of pseudocode needed in the type definition for ComputerRecord.
…
… [1]
(ii)
The values for the field ComputerID must be between 1000 and 1999 inclusive.
Rewrite one pseudocode line from the type definition of ComputerRecord to implement
the change.
…
… [1]
(c) Data about all the computers are stored in a file that uses random file organisation.
ComputerID is used as the key field.
Explain how a program could search for a record stored in this file.
…
…
…
…
…
… [3]
Question text
2
The TCP/IP protocol suite can be viewed as a stack with four layers.
(a) Complete the diagram by writing the names of the three missing layers.
Layer
Transport
[3]
(b) State the purpose of each of the following protocols.
HTTP …
…
…
FTP …
…
…
POP3 …
…
…
SMTP …
…
…
[4]
Question text
3
Hamish is constructing a Local Area Network (LAN) using Ethernet with CSMA/CD.
(a) Identify and draw a diagram of the most appropriate topology for this LAN.
Topology …
Diagram:
[3]
(b) Explain how devices on the LAN use CSMA/CD.
…
…
…
…
…
…
…
… [4]
Question text
4
(a) The truth table for a logic circuit with four inputs is shown.
INPUT
OUTPUT
P
Q
R
S
X
0
0
0
0
1
0
0
0
1
1
0
0
1
0
0
0
0
1
1
0
0
1
0
0
0
0
1
0
1
0
0
1
1
0
0
0
1
1
1
0
1
0
0
0
0
1
0
0
1
0
1
0
1
0
0
1
0
1
1
0
1
1
0
0
0
1
1
0
1
0
1
1
1
0
1
1
1
1
1
1
(i)
Write the Boolean algebraic expression for the truth table as a sum-of-products.
X = … [2]
(ii)
Complete the following Karnaugh Map (K-map) for the truth table.
PQ
00
01
11
10
00
01
RS
11
10
[2]
(iii)
The K-map can be used to simplify the expression in part (a)(i).
Draw loop(s) around appropriate groups in the K-map to produce an optimal
sum-of-products.
[2]
(iv)
Write the simplified sum-of-products from the K-map.
X = … [2]
(b) Simplify the expression for X, as represented by the truth table in part (a), using Boolean
Algebra.
…
…
…
… [2]
Question text
5
(a) Flora has written a program that uses the variables a, b, c and d.
Part of the program contains the following calculations:
a
=
2
b
=
5
c
=
7
d
=
a * b – (a + b + c)
(i)
Write the Reverse Polish Notation (RPN) for the expression:
a * b – (a + b + c)
… [2]
(ii)
Show the changing contents of the stack as the value for variable d is calculated from
the RPN expression.
[4]
(b) Convert the following RPN expression back to its original infix form.
d b * b c d + - + a /
…
…
…
…
… [3]
(c) Explain why expressions are evaluated using RPN.
…
…
…
…
…
… [3]
Question text
6
Mohammad is working away from his company’s head office. He wants to send a secure message
over a computer network to the head office.
(a) (i)
Explain the way in which a digital signature for the message would be produced.
…
…
…
…
…
…
…
… [4]
(ii)
State two reasons why a digital signature for the message is required.
1 …
…
2 …
…
[2]
(b) The message is encrypted using asymmetric key cryptography before it is sent and decrypted
when it arrives at the head office.
(i)
Describe this process of encrypting and decrypting the message.
…
…
…
…
…
…
…
…
…
… [5]
(ii)
State one reason for using asymmetric key cryptography.
…
… [1]
Question text
7
A large apartment block has 20 floors. On each floor there is one security camera and four sensors.
The image from each security camera is output to a display screen for that floor.
•
There are 20 display screens in the reception area on the lowest floor.
•
The data from the sensors are read and processed by a computer system.
•
Warning messages can also be displayed on each display screen.
(a) (i)
Identify the type of system described.
… [1]
(ii)
Justify your answer to part (a)(i).
…
…
…
… [2]
(iii)
Identify two types of sensor that could be used by this system.
State a reason for the use of each sensor.
Sensor 1 …
Reason …
…
Sensor 2 …
Reason …
…
[4]
(b) A program regularly checks each sensor’s readings. If the value of the reading is out of range,
a warning message is displayed on the screen for that floor.
A pseudocode algorithm to output the warnings has been written using these identifiers.
Identifier
Data type
Description
FloorNumber
INTEGER
Floor number
SensorNumber
INTEGER
Sensor number
Always
BOOLEAN
Value to ensure continuous loop
The pseudocode algorithm uses:
•
the function CheckSensor(Floor, Sensor) that returns TRUE if the sensor reading
is out of range and FALSE otherwise
•
the procedure ScreenOut(Floor, Sensor) that outputs the warning message
"Problem on Floor" to the appropriate screen.
(i)
Complete the pseudocode algorithm.
…
01 Always
02 REPEAT
1 TO …
03
FOR FloorNumber
1 TO …
04
FOR SensorNumber
05
IF CheckSensor(FloorNumber, SensorNumber)
06
THEN
07
ScreenOut(FloorNumber, SensorNumber)
08
ENDIF
09
ENDFOR
10
ENDFOR
11
12 // delay loop
13 // delay loop
14 UNTIL …
[4]
(ii)
Write a delay loop in pseudocode for lines 12 and 13 of the pseudocode algorithm.
…
…
… [2]
(c) If a sensor reading is out of range, a bit is set in a memory location allocated to that floor. The
addresses for the memory locations are 401 to 420.
For example, memory location 401 is used to store the status of the sensors 1 to 4 on floor 1,
memory location 402 is used t