Past paper – A Level Computer Science (old syllabus, to 2021) (9608)
Cambridge International AS & A Level · 9608
Computer Science (old syllabus, to 2021) · Paper 32
Oct/Nov 2021 · 9608/32/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, BicycleRecord, is defined in pseudocode as:
TYPE BicycleRecord
DECLARE BicycleID
:
INTEGER
DECLARE BicycleAvailable :
BOOLEAN
DECLARE BicycleLocation : (RiverSide, BusStation, TrainStation,
TownSquare, Library)
DECLARE DateChecked
:
DATE
ENDTYPE
A variable, LoanBicycle, is declared in pseudocode as:
DECLARE LoanBicycle : BicycleRecord
(a) Write pseudocode statements to assign 567 to the BicycleID of LoanBicycle and
FALSE to the BicycleAvailable of LoanBicycle.
…
… [2]
(b) The type definition for BicycleRecord is changed.
(i)
The definition has been extended to include borrower identification numbers,
BorrowerID, for the last 10 people who borrowed a bicycle. Each identification number
is an integer.
Write the pseudocode statement needed in the type definition of BicycleRecord.
…
… [1]
(ii)
The values for the field BicycleID must be between 500 and 599 inclusive.
Rewrite one pseudocode line from the type definition of BicycleRecord to implement
the change.
…
… [1]
(c) Data about all the bicycles are stored in a file that uses random file organisation.
BicycleID is used as the key field.
Explain how a program could add an extra record to this file.
…
…
…
…
…
… [3]
Question text
2
The TCP/IP protocol suite can be viewed as a stack with four layers.
(a) Complete the diagram of the stack by writing the names of the three missing layers.
Layer
Internet / Network
[3]
(b) Describe the TCP and IP protocols.
TCP …
…
…
…
IP …
…
…
…
[4]
Question text
3
(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
0
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
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
0
1
1
1
0
0
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, represented by the truth table in part (a), using Boolean
Algebra.
…
…
…
… [2]
Question text
4
Babar is building a wireless Local Area Network (LAN).
(a) Identify two differences between a wireless network and a wired network.
1 …
…
…
2 …
…
…
[2]
(b) Identify the hardware device needed to connect the wireless LAN to the Internet. Justify your
choice.
Device …
Justification …
…
…
[2]
Question text
5
(a) Flora has written a program that uses the variables p, q, r and s.
Part of the program contains the following calculations:
p
=
5
q
=
4
r
=
1
s
=
p * (p - q + r)
(i)
Write the Reverse Polish Notation (RPN) for the expression:
p * (p - q + r)
… [2]
(ii)
Show the changing contents of the stack as the value for s is calculated from the RPN
expression.
[4]
(b) Convert this RPN expression back to its original infix form.
p q * p q r + - + p /
…
…
…
…
… [3]
(c) Syntax analysis is one stage of the compilation of a program.
Identify and describe two other stages of compilation.
Stage 1 …
Description …
…
…
Stage 2 …
Description …
…
…
[4]
Question text
6
Lara wants to send an important message to her bank over the Internet.
(a) Explain why the bank requires a digital signature for the message.
…
…
…
… [2]
(b) Asymmetric key cryptography is used to keep Lara’s message secure during transmission
over the Internet.
Describe this process of encrypting and decrypting Lara’s message.
…
…
…
…
…
…
…
…
…
… [5]
(c) Lara has received an email message that appears to be from her bank. She is not sure
whether it is authentic.
State two problems that could occur if Lara opens and responds to this suspicious email
message.
1 …
…
2 …
…
[2]
Question text
7
A virtual machine is the software emulation of a computer system using another computer system.
Describe two benefits and two limitations of using a virtual machine.
Benefit 1 …
…
…
Benefit 2 …
…
…
Limitation 1 …
…
…
Limitation 2 …
…
…
[4]
Question text
8
A large car park has 6 floors.
There is a large screen at the entrance to the car park. This screen displays the number of empty
parking spaces on each floor.
•
There are 256 parking spaces for cars on each floor.
•
Each parking space has a sensor that detects if a car is parked on it.
•
Data from the sensors are read and processed by a computer system.
(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.
Sensor 1 …
Sensor 2 …
[2]
(b) A program regularly checks each sensor’s readings.
The number of empty parking spaces is displayed on the screen for each floor. If there are no
empty parking spaces on a floor, a message is displayed on the screen to show that the floor
is full.
The pseudocode algorithm to display this information has been written using these identifiers.
Identifier
Data type
Description
FloorNumber
INTEGER
Floor number
SpaceNumber
INTEGER
Parking space number
SpaceAvailable
INTEGER
Counts number of empty parking spaces
on a floor
ForEver
BOOLEAN
Value to ensure continuous loop
The pseudocode algorithm uses the function CheckSpace(Floor, Space). This function
returns TRUE if the parking space is empty and FALSE otherwise.
(i)
Complete the following pseudocode algorithm to check the number of parking spaces
available.
…
01 ForEver
02 REPEAT
1 TO …
03
FOR FloorNumber
0
04
SpaceAvailable
1 TO …
05
FOR SpaceNumber
06
IF CheckSpace(FloorNumber, SpaceNumber)
07
THEN
SpaceAvailable + 1
08
SpaceAvailable
09
ENDIF
10
ENDFOR
11
IF SpaceAvailable > …
12
THEN
13
OUTPUT "Floor ", … ,
" empty parking spaces " …
14
ELSE
15
OUTPUT "Floor ", … , " full"
16
ENDIF
17
ENDFOR
18
19 // delay loop
20 // delay loop
21 UNTIL …
[6]
(ii)
Write a delay loop in pseudocode for lines 19 and 20 of the pseudocode algorithm.
…
…
…
… [2]
(iii)
State why a delay loop is used in this system.
…
… [1]
(c) When a car is parked in a parking space, a bit is set in the appropr