9618 Computer Science
9618 Computer Science
* 4 7 5 7 0 1 8 5 5 9 *
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (LK/CB) 205788/1
© UCLES 2021 [Turn over
2
1 Real numbers are stored in a computer system using floating-point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(b) Calculate the denary value of the given binary floating-point number.
Show your working.
Mantissa Exponent
1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Mantissa Exponent
0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(d) The denary number 513 cannot be stored accurately as a normalised floating-point number in
this computer system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) Describe an alteration to the way floating-point numbers are stored to enable this number
to be stored accurately using the same total number of bits.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(i) SchoolDay to hold data about the days students are usually in school.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) WeekEnd to hold data about the days that are not school days.
...........................................................................................................................................
..................................................................................................................................... [1]
(c) Define, using pseudocode, the composite data type ClubMeet. This will hold data about club
members that includes:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
3 (a) Draw one line to connect each Operating System (OS) term to the most appropriate
description about it.
OS term Description
Interrupt handling
Scheduling
Transferring control to another routine when
a service is required
Virtual memory
Reading/writing same-size blocks of data
from/to secondary storage when required
[5]
(b) Explain how an interpreter executes a program without producing a complete translated
version of it.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
4 (a) (i) Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of
expressions.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Identify, with reasons, a data structure that could be used to evaluate an expression
in RPN.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(a – b) * (a + c) / 7
...................................................................................................................................................
............................................................................................................................................. [1]
a b / 4 * a b + -
...................................................................................................................................................
............................................................................................................................................. [1]
a b + c d / /
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
5 (a) Calculate the shortest distance between the base and each of the other towns in the diagram
using Dijkstra’s algorithm.
Show your working and write your answers in the table provided.
Base
4
5
Town 1 2
1 Town 2
8
Town 3
7 3 Town 6
1
5
6
Town 4 Town 5
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answers
[5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Benefit 1 ...........................................................................................................................................
..........................................................................................................................................................
Benefit 2 ...........................................................................................................................................
..........................................................................................................................................................
Drawback 1 ......................................................................................................................................
..........................................................................................................................................................
Drawback 2 ......................................................................................................................................
..........................................................................................................................................................
[4]
A P
Y
B
C R
Z
Q
(a) Complete the truth table for the given logic circuit. Show your working.
............................................................................................................................................. [1]
(c) Write the Boolean expressions for the two outputs Y and Z in the truth table as
sum-of-products and state the purpose of each output.
Y = ............................................................................................................................................
Purpose ....................................................................................................................................
Z = ............................................................................................................................................
Purpose ....................................................................................................................................
[4]
8 (a) State two factors that may affect the performance of a sorting algorithm.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) The given algorithm is a simple bubble sort that arranges a set of scores stored in a one-
dimensional array into descending order, and orders the corresponding students’ names
stored into a two-dimensional array in the same order as the scores. All the arrays are indexed
from 1.
Name
Score
1 2
1 98 1 Smithfield Tom
2 97 2 Johnson Jane
… …
YearSize 249 ←
Flag ←
TRUE
WHILE Flag = TRUE
Flag FALSE←
FOR Student ←
1 TO YearSize - 1
IF Score[Student] < Score[Student + 1] THEN
Temp1 ←
Score[Student]
Temp2 ←
Name[Student,1]
Temp3 ←
Name[Student,2]
Score[Student] Score[Student + 1] ←
Name[Student,1] Name[Student + 1,1] ←
Name[Student,2] Name[Student + 1,2] ←
Score[Student + 1] Temp1 ←
Name[Student + 1,1] Temp2 ←
Name[Student + 1,2] Temp3 ←
Flag TRUE ←
ENDIF
NEXT Student
ENDWHILE
Write an algorithm, using pseudocode, that will perform the same task using an insertion sort.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Identify the programming paradigm for each of these program code examples.
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (RW/SW) 206388/2
© UCLES 2021 [Turn over
2
(i) Write the normalised floating-point representation of the following unsigned binary
number using this system.
1011100.011001
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Mantissa Exponent
[2]
(ii) State the consequence of storing the binary number in part (a)(i) as a floating-point
number in this system. Justify your answer.
Consequence ....................................................................................................................
...........................................................................................................................................
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(b) Explain the reason why binary numbers are stored in normalised form.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© UCLES 2021 9618/32/O/N/21
3
2 Draw one line from each programming paradigm to its most appropriate description.
Declarative
Programs based on events such as user
actions or sensor outputs
Imperative
Programs using the concepts of class,
inheritance, encapsulation and
polymorphism
Low-level
[4]
(a) Write pseudocode to create an enumerated type called Parts to include these parts sold in
a computer shop:
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Write pseudocode to create a pointer type called SelectParts that will reference the
memory location in which the current part name is stored.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
4 The following syntax diagrams for a particular programming language show the syntax of:
• a digit
• a capital letter
• a character.
1 E
2 I
3 O
4 U
5 character
$
6
%
7
&
8
*
9
#
(a) Write the Backus-Naur Form (BNF) notation of the syntax diagram for character.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A password must begin with a character and be followed by one or more digits or capital
letters.
..................................................................................................................................... [1]
password
character digit
capital letter
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) State the most suitable method of file access when a record is referenced by a unique
address on a disk-type storage medium.
............................................................................................................................................. [1]
(c) State the most suitable method of file access when a bank stores its data records in ascending
order of account number.
............................................................................................................................................. [1]
6 (a) Explain how packet switching is used to transfer messages across the internet.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
7 (a) Write the Boolean expression that corresponds to the given truth table as a sum-of-products.
INPUT OUTPUT
A B C D Z
0 0 0 0 0
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 0
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Z = ............................................................................................................................................
............................................................................................................................................. [3]
(b) (i) Complete the Karnaugh map (K-map) for the given truth table.
AB
CD 00 01 11 10
00
01
11
10
[2]
(ii) Draw loop(s) around appropriate group(s) of 1s in the K-map to produce an optimal
sum-of-products. [2]
(iii) Write the Boolean expression from your answer to part b(ii) as a simplified
sum-of-products.
Z = .....................................................................................................................................
..................................................................................................................................... [2]
(iv) Write the simplified Boolean expression for your answer to part b(iii).
Z = .....................................................................................................................................
..................................................................................................................................... [1]
8 (a) Describe the purpose of the Secure Sockets Layer (SSL) and Transport Layer Security (TLS)
protocols.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain how SSL/TLS protocols are used when a client-server communication is initiated.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
Output
Layer
Input
Layer
Hidden Hidden
Layer 1 Hidden Layer 3
Layer 2
(i) State the reason for having multiple hidden layers in an artificial neural network.
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(b) Find the shortest path between the Home and School nodes using the A* algorithm.
Show your working in the table provided.
14
h = 10 Home 9
g=1 4
A 5 C
3
7
B 6
2
6
D 6
3
7
F
1
2
3
E
3 5
School
Home 0 14 14
A 1 10 11
Final path
[5]
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
(b) Explain the reasons why a stack is a suitable Abstract Data Type (ADT) to implement
recursion.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
1 ................................................................................................................................................
2 ................................................................................................................................................
[2]
The function uses the variable TopOfStack to represent the pointer to the most recent
position used on the stack, and the variable Max to represent the maximum size of the stack.
Assume TopOfStack and Max are global variables.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
ENDFUNCTION
[5]
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (RW/CGW) 302516/4
© UCLES 2022 [Turn over
2
1 Normalised floating-point numbers are stored in a computer system using two’s complement for
both the mantissa and the exponent with:
(a) Write the largest positive two’s complement binary number that can be stored in this system.
Mantissa Exponent
[1]
(b) Calculate the denary value of the given binary floating-point number.
Show your working.
Mantissa Exponent
1 0 1 1 0 0 1 0 0 1 1 0 1 0 0 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
2 Lexical analysis and syntax analysis are stages in the compilation of a program.
(a) Identify two other stages that take place during the compilation of a program.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Transport
Link
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
© UCLES 2022 9618/32/O/N/22 [Turn over
4
4 A program to manage regular flight details at an airport requires some user-defined data types.
(a) Write pseudocode statements to declare the enumerated data type Aircraft to hold data
about the types of aircraft used for a flight.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Write pseudocode statements to declare the composite data type Flight to hold data about
flights to a specific destination. These include:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(c) (i) Write the pseudocode statement to set up a variable for one record of the composite
data type Flight.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Write pseudocode to store the details of the following flight in the variable you set up in
part (c)(i).
Field Data
flight number XA782
destination Cambridge
date of departure 12/12/2022
type of aircraft used C350
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
Description .......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Benefit 1 ...........................................................................................................................................
..........................................................................................................................................................
Benefit 2 ...........................................................................................................................................
..........................................................................................................................................................
Drawback 1 ......................................................................................................................................
..........................................................................................................................................................
Drawback 2 ......................................................................................................................................
..........................................................................................................................................................
[6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain the process by which an organisation may acquire its digital certificate.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]
8 (a) Draw a logic circuit for an SR flip-flop and label the inputs.
.................
Q̄
.................
[4]
...................................................................................................................................................
............................................................................................................................................. [1]
(c) Simplify the following expression using Boolean algebra, including De Morgan’s laws.
Show your working.
(A.B).(A.C).(B.D)
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) Describe these scheduling routines and identify a benefit for each one.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
Encapsulation ...........................................................................................................................
...................................................................................................................................................
Getter ........................................................................................................................................
...................................................................................................................................................
Setter ........................................................................................................................................
...................................................................................................................................................
[3]
(b) A school has a program written using OOP to maintain its staff and student records.
The object SubstituteTeacher allows the details of the school’s substitute teachers to be
stored. This includes their full name, telephone number and whether or not they are in school
today. For example:
Complete the diagram for the object SubstituteTeacher, including appropriate properties
and their getters and setters.
SubstituteTeacher
SubName : STRING
....................................................................................................
InSchool : BOOLEAN
....................................................................................................
SetTelephone(Tel : STRING)
....................................................................................................
GetSubName()
....................................................................................................
....................................................................................................
[3]
11 A simplified linked list is used to store the names of flowers in alphabetical order. It is implemented
using two 1D arrays:
HeadPointer indicates the index of the first flower name in the linked list.
HeadPointer 6
When the end of the linked list is reached, the next pointer has the value of 0.
(a) Several flower names have been deleted from the linked list. These are crossed out in the
following table.
Complete the table to show the new values of HeadPointer and NextPointer to keep the
remaining flower names in alphabetical order.
HeadPointer
(b) Complete the pseudocode algorithm so that it achieves the following when applied to the
arrays:
Pointer HeadPointer
Found 0
OUTPUT "Enter a flower name "
………………………………………………………………….
………………………………………………………………….
IF Flower[Pointer] = FlowerName THEN
Found Pointer
Pointer 0
ELSE
………………………………………………………………….
ENDIF
ENDWHILE
………………………………………………………………….
OUTPUT Flower[Found], " is found"
ELSE
………………………………………………………………….
ENDIF
[5]
(c) Explain how you could improve the simplified linked list structure.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (RW/FC) 313065/3
© UCLES 2023 [Turn over
2
(a) Write the normalised floating‑point representation of the following binary number using this
system:
0101010.111
Show your working.
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Mantissa Exponent
[2]
(b) Describe the reason why the normalised form of the following binary number cannot be
represented accurately using this system.
0101011.111001
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
2 (a) Describe how records are organised and accessed in a sequential file.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) A hashing algorithm is used to calculate storage locations for records in a random access file.
The algorithm calculates hash values using the function modulus 5.
3003 3
1029
7630
[2]
digit letter
0 A
1 C
2 E
3 G
4 I
5 K
6 M
7 O
8 Q
9 S
Y
variable
letter digit
(a) State whether each variable is valid or invalid and give a reason for your choice in each case.
9SW ...........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
UWY ...........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
[2]
Complete the Backus‑Naur Form (BNF) for <word> and use this to complete the BNF for
<variable>.
...................................................................................................................................................
...................................................................................................................................................
[3]
(c) Vehicle registrations must begin with two letters and be followed by one, two or three digits.
Valid letters and digits are shown in the syntax diagrams on page 4.
...........................................................................................................................................
..................................................................................................................................... [1]
[3]
4 Draw one line from each Object‑Oriented Programming (OOP) term to its most appropriate
description.
Setters
enables the defining of a new class
that inherits from a parent class
[4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain the differences between symmetric and asymmetric cryptography when encrypting
and decrypting data.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
6 (a) Write pseudocode statements to declare the composite data type, TAppointments, to hold
data about patients for a dental clinic. It will include for each patient:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) This pseudocode algorithm reads dental records stored in a random file using the user‑defined
data type TAppointments and prints the contents of the file, one record at a time.
OPENFILE .................................................................................................................
.......................................................................................... 1
REPEAT
SEEK DentalFile, Count
.....................................................................................................................
OUTPUT DentalRecord[Count]
Count Count + 1
.....................................................................(DentalFile)
.............................................................................................
[5]
7 (a) State two examples of where it would be appropriate to use packet switching.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Give four differences between circuit switching and packet switching.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
4 ................................................................................................................................................
...................................................................................................................................................
[4]
8 (a) Describe the use of pipelining in Reduced Instruction Set Computers (RISC).
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Each stage is carried out using a different register when pipelining is used.
Complete the table to show how a program consisting of six instructions would be completed
using pipelining.
Clock cycles
1 2 3 4 5 6 7 8 9 10 11 12
IF
Processor stages
ID
OF
IE
WB
[4]
INPUT OUTPUT
A B C D Z
0 0 0 0 1
0 0 0 1 1
0 0 1 0 1
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 1
0 1 1 1 1
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 0
1 1 1 1 0
(a) Write the Boolean logic expression that corresponds to the given truth table as the
sum‑of‑products.
Z = ............................................................................................................................................
............................................................................................................................................. [3]
(b) Complete the Karnaugh map (K‑map) for the given truth table.
AB
CD 00 01 11 10
00
01
11
10
[2]
(c) Draw loop(s) around appropriate group(s) in the K‑map to produce an optimal sum‑of‑products.
[2]
(d) Write the Boolean logic expression from your answer to part (c) as a simplified
sum‑of‑products.
Z = ............................................................................................................................................
............................................................................................................................................. [2]
(e) Use Boolean algebra to give your answer to part (d) in its simplest form.
Z = ...................................................................................................................................... [1]
............................................................................................................................................. [1]
(b) Calculate the path that takes the shortest time to travel from the Begin node to the End node,
using the A* algorithm.
Show your working in the table provided.
12
g=5 Begin
h=8 4 11
A 5
D
6 7
7 C
6 B
8 6
2
8 7
E
5
7 G
End
7 1
4
1 F
Cost from
Destination Heuristic Total
Start node start node
node (h) (f = g + h)
(g)
Begin Begin 0 12 12
Begin A 5 8 13
Final path
[5]
© UCLES 2023 9618/32/M/J/23
13
11 (a) The pseudocode shown represents a queue Abstract Data Type (ADT) with procedures for
initialisation and to add new items. It is incomplete.
CONSTANT MaxLength = 50
DECLARE FrontPointer : INTEGER
DECLARE RearPointer : INTEGER
DECLARE Length : INTEGER
DECLARE Queue : ARRAY[0 : MaxLength – 1] OF STRING
// initialisation of queue
PROCEDURE Initialise
FrontPointer ‑1
.....................................................................................................................
................................................................. 0
ENDPROCEDURE
IF ............................................................................................. THEN
RearPointer ..................................................................................
IF RearPointer > MaxLength – 1 THEN
RearPointer 0
ENDIF
................................................................................................................
Length Length + 1
ENDIF
ENDPROCEDURE
(i) Study the pseudocode and insert the identifiers to complete this table.
(b) Explain the reasons why a queue ADT works better than a stack ADT in organising print jobs.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third‑party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer‑related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (EF/CT) 318340/2
© UCLES 2023 [Turn over
2
1 (a) Real numbers are stored in a computer using floating point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(b) Explain why a binary representation is sometimes only an approximation to the real number it
represents.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Composite ........................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Non‑composite .................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain how a collision can be dealt with when writing records to a random file.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
4 Complete the following paragraph about a protocol suite, using words from the given list.
............................................................................. model.
[3]
5 (a) Outline the reasons why an operating system may need to use virtual memory.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
a b * 2 / c d / *
Show the changing contents of the following stack as the RPN expression is evaluated.
[4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
B X
A B C X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[1]
X = ...................................................................................................................................... [1]
T = X.Y.Z + X.Y.Z + X
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
8 Calculate the shortest distance between the Start and each of the destinations in the diagram
using Dijkstra’s algorithm.
Show your working and write your answers in the table provided.
4 8
A B
C
2
3
8 9
D
2
Start 10
F
Working ............................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Answers:
A B C D E F
[5]
9 (a) A stack Abstract Data Type (ADT) is to be implemented using pseudocode, with procedures
to initialise it and to push new items onto the stack.
(i) Study the pseudocode in part (a)(ii) and complete the table of identifiers by writing the
missing data types and descriptions.
BasePointer
TopPointer
Stack REAL
[2]
CONSTANT MaxSize = 40
DECLARE BasePointer : INTEGER
DECLARE TopPointer : INTEGER
DECLARE Stack : ARRAY[1:40] OF REAL
// initialisation of stack
PROCEDURE Initialise()
................................................................................ 1
................................................................................ 0
ENDPROCEDURE
..........................................................................................................
Stack[TopPointer] .............................................................
ENDIF
ENDPROCEDURE
[5]
(b) Justify the use of a linked list instead of an array to implement a stack.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Explain how a compiler makes use of a stack when translating recursive programming code.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
SIMD ................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
MISD ................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]
11 A declarative programming language is used to represent some facts about people and their
hobbies.
01 hobby(music).
02 hobby(caving).
03 hobby(climbing).
04 hobby(camping).
05 hobby(baking).
06 hobby(travelling).
07 person(toby).
08 person(natasha).
09 person(fatima).
10 person(joseph).
11 person(elijah).
12 person(nina).
13 enjoys(natasha, travelling).
14 enjoys(toby, climbing).
15 enjoys(nina, climbing).
16 enjoys(elijah, camping).
17 enjoys(fatima, baking).
18 enjoys(joseph, camping).
19 dislikes(toby, caving).
Clause Meaning
01 Music is a hobby
07 Toby is a person
13 Natasha enjoys travelling
19 Toby dislikes caving
(a) Carlos is a person who enjoys the hobby of cycling but does not like music.
20 ............................................................................................................................................
21 ............................................................................................................................................
22 ............................................................................................................................................
23 ............................................................................................................................................
[4]
enjoys(P, camping)
returns
P = elijah, joseph
enjoys(P, climbing)
P = .................................................................................................................................... [1]
(c) N is a person who might enjoy H if H is a hobby and N does not dislike H.
might_enjoy(N, H)
IF ............................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
The records are stored using the user‑defined data type TAccount.
TYPE TAccount
DECLARE AccountNumber : INTEGER
DECLARE Name : STRING
DECLARE Address : STRING
DECLARE Telephone : STRING
ENDTYPE
OPENFILE ...............................................................................................................
Location 1
............................................................................................................... FALSE
OUTPUT "Enter the customer’s name"
...............................................................................................................
OUTPUT ".........................................................................................................."
ENDIF
[7]
© UCLES 2023 9618/32/O/N/23
13
BLANK PAGE
BLANK PAGE
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third‑party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer‑related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (LO) 213987
© UCLES 2021 [Turn over
2
1 Real numbers are stored in a computer system using floating-point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(b) Calculate the denary value of the given binary floating-point number.
Show your working.
Mantissa Exponent
1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Mantissa Exponent
0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(d) The denary number 513 cannot be stored accurately as a normalised floating-point number in
this computer system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) Describe an alteration to the way floating-point numbers are stored to enable this number
to be stored accurately using the same total number of bits.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(i) SchoolDay to hold data about the days students are usually in school.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) WeekEnd to hold data about the days that are not school days.
...........................................................................................................................................
..................................................................................................................................... [1]
(c) Define, using pseudocode, the composite data type ClubMeet. This will hold data about club
members that includes:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
3 (a) Draw one line to connect each Operating System (OS) term to the most appropriate
description about it.
OS term Description
Interrupt handling
Scheduling
Transferring control to another routine when
a service is required
Virtual memory
Reading/writing same-size blocks of data
from/to secondary storage when required
[5]
(b) Explain how an interpreter executes a program without producing a complete translated
version of it.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
4 (a) (i) Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of
expressions.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Identify, with reasons, a data structure that could be used to evaluate an expression
in RPN.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(a – b) * (a + c) / 7
...................................................................................................................................................
............................................................................................................................................. [1]
a b / 4 * a b + -
...................................................................................................................................................
............................................................................................................................................. [1]
a b + c d / /
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
5 (a) Calculate the shortest distance between the base and each of the other towns in the diagram
using Dijkstra’s algorithm.
Show your working and write your answers in the table provided.
Base
4
5
Town 1 2
1 Town 2
8
Town 3
7 3 Town 6
1
5
6
Town 4 Town 5
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answers
[5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Benefit 1 ...........................................................................................................................................
..........................................................................................................................................................
Benefit 2 ...........................................................................................................................................
..........................................................................................................................................................
Drawback 1 ......................................................................................................................................
..........................................................................................................................................................
Drawback 2 ......................................................................................................................................
..........................................................................................................................................................
[4]
A P
Y
B
C R
Z
Q
(a) Complete the truth table for the given logic circuit. Show your working.
............................................................................................................................................. [1]
(c) Write the Boolean expressions for the two outputs Y and Z in the truth table as
sum-of-products and state the purpose of each output.
Y = ............................................................................................................................................
Purpose ....................................................................................................................................
Z = ............................................................................................................................................
Purpose ....................................................................................................................................
[4]
8 (a) State two factors that may affect the performance of a sorting algorithm.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) The given algorithm is a simple bubble sort that arranges a set of scores stored in a one-
dimensional array into descending order, and orders the corresponding students’ names
stored into a two-dimensional array in the same order as the scores. All the arrays are indexed
from 1.
Name
Score
1 2
1 98 1 Smithfield Tom
2 97 2 Johnson Jane
… …
YearSize 249 ←
Flag ←
TRUE
WHILE Flag = TRUE
Flag FALSE←
FOR Student ←
1 TO YearSize - 1
IF Score[Student] < Score[Student + 1] THEN
Temp1 ←
Score[Student]
Temp2 ←
Name[Student,1]
Temp3 ←
Name[Student,2]
Score[Student] Score[Student + 1] ←
Name[Student,1] Name[Student + 1,1] ←
Name[Student,2] Name[Student + 1,2] ←
Score[Student + 1] Temp1 ←
Name[Student + 1,1] Temp2 ←
Name[Student + 1,2] Temp3 ←
Flag TRUE ←
ENDIF
NEXT Student
ENDWHILE
Write an algorithm, using pseudocode, that will perform the same task using an insertion sort.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Identify the programming paradigm for each of these program code examples.
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (SLM) 220617
© UCLES 2021 [Turn over
2
(i) Write the normalised floating-point representation of the following unsigned binary
number using this system.
1011100.011001
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Mantissa Exponent
[2]
(ii) State the consequence of storing the binary number in part (a)(i) as a floating-point
number in this system. Justify your answer.
Consequence ....................................................................................................................
...........................................................................................................................................
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(b) Explain the reason why binary numbers are stored in normalised form.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© UCLES 2021 9618/31/O/N/21
3
2 Draw one line from each programming paradigm to its most appropriate description.
Declarative
Programs based on events such as user
actions or sensor outputs
Imperative
Programs using the concepts of class,
inheritance, encapsulation and
polymorphism
Low-level
[4]
(a) Write pseudocode to create an enumerated type called Parts to include these parts sold in
a computer shop:
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Write pseudocode to create a pointer type called SelectParts that will reference the
memory location in which the current part name is stored.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
4 The following syntax diagrams for a particular programming language show the syntax of:
• a digit
• a capital letter
• a character.
1 E
2 I
3 O
4 U
5 character
$
6
%
7
&
8
*
9
#
(a) Write the Backus-Naur Form (BNF) notation of the syntax diagram for character.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A password must begin with a character and be followed by one or more digits or capital
letters.
..................................................................................................................................... [1]
password
character digit
capital letter
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) State the most suitable method of file access when a record is referenced by a unique
address on a disk-type storage medium.
............................................................................................................................................. [1]
(c) State the most suitable method of file access when a bank stores its data records in ascending
order of account number.
............................................................................................................................................. [1]
6 (a) Explain how packet switching is used to transfer messages across the internet.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
7 (a) Write the Boolean expression that corresponds to the given truth table as a sum-of-products.
INPUT OUTPUT
A B C D Z
0 0 0 0 0
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 0
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Z = ............................................................................................................................................
............................................................................................................................................. [3]
(b) (i) Complete the Karnaugh map (K-map) for the given truth table.
AB
CD 00 01 11 10
00
01
11
10
[2]
(ii) Draw loop(s) around appropriate group(s) of 1s in the K-map to produce an optimal
sum-of-products. [2]
(iii) Write the Boolean expression from your answer to part b(ii) as a simplified
sum-of-products.
Z = .....................................................................................................................................
..................................................................................................................................... [2]
(iv) Write the simplified Boolean expression for your answer to part b(iii).
Z = .....................................................................................................................................
..................................................................................................................................... [1]
8 (a) Describe the purpose of the Secure Sockets Layer (SSL) and Transport Layer Security (TLS)
protocols.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain how SSL/TLS protocols are used when a client-server communication is initiated.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
Output
Layer
Input
Layer
Hidden Hidden
Layer 1 Hidden Layer 3
Layer 2
(i) State the reason for having multiple hidden layers in an artificial neural network.
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(b) Find the shortest path between the Home and School nodes using the A* algorithm.
Show your working in the table provided.
14
h = 10 Home 9
g=1 4
A 5 C
3
7
B 6
2
6
D 6
3
7
F
1
2
3
E
3 5
School
Home 0 14 14
A 1 10 11
Final path
[5]
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
(b) Explain the reasons why a stack is a suitable Abstract Data Type (ADT) to implement
recursion.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
1 ................................................................................................................................................
2 ................................................................................................................................................
[2]
The function uses the variable TopOfStack to represent the pointer to the most recent
position used on the stack, and the variable Max to represent the maximum size of the stack.
Assume TopOfStack and Max are global variables.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
ENDFUNCTION
[5]
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (LO) 213986
© UCLES 2021 [Turn over
2
1 Real numbers are stored in a computer system using floating-point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(b) Calculate the denary value of the given binary floating-point number.
Show your working.
Mantissa Exponent
1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Mantissa Exponent
0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(d) The denary number 513 cannot be stored accurately as a normalised floating-point number in
this computer system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) Describe an alteration to the way floating-point numbers are stored to enable this number
to be stored accurately using the same total number of bits.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(i) SchoolDay to hold data about the days students are usually in school.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) WeekEnd to hold data about the days that are not school days.
...........................................................................................................................................
..................................................................................................................................... [1]
(c) Define, using pseudocode, the composite data type ClubMeet. This will hold data about club
members that includes:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
3 (a) Draw one line to connect each Operating System (OS) term to the most appropriate
description about it.
OS term Description
Interrupt handling
Scheduling
Transferring control to another routine when
a service is required
Virtual memory
Reading/writing same-size blocks of data
from/to secondary storage when required
[5]
(b) Explain how an interpreter executes a program without producing a complete translated
version of it.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
4 (a) (i) Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of
expressions.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Identify, with reasons, a data structure that could be used to evaluate an expression
in RPN.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(a – b) * (a + c) / 7
...................................................................................................................................................
............................................................................................................................................. [1]
a b / 4 * a b + -
...................................................................................................................................................
............................................................................................................................................. [1]
a b + c d / /
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
5 (a) Calculate the shortest distance between the base and each of the other towns in the diagram
using Dijkstra’s algorithm.
Show your working and write your answers in the table provided.
Base
4
5
Town 1 2
1 Town 2
8
Town 3
7 3 Town 6
1
5
6
Town 4 Town 5
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answers
[5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Benefit 1 ...........................................................................................................................................
..........................................................................................................................................................
Benefit 2 ...........................................................................................................................................
..........................................................................................................................................................
Drawback 1 ......................................................................................................................................
..........................................................................................................................................................
Drawback 2 ......................................................................................................................................
..........................................................................................................................................................
[4]
A P
Y
B
C R
Z
Q
(a) Complete the truth table for the given logic circuit. Show your working.
............................................................................................................................................. [1]
(c) Write the Boolean expressions for the two outputs Y and Z in the truth table as
sum-of-products and state the purpose of each output.
Y = ............................................................................................................................................
Purpose ....................................................................................................................................
Z = ............................................................................................................................................
Purpose ....................................................................................................................................
[4]
8 (a) State two factors that may affect the performance of a sorting algorithm.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) The given algorithm is a simple bubble sort that arranges a set of scores stored in a one-
dimensional array into descending order, and orders the corresponding students’ names
stored into a two-dimensional array in the same order as the scores. All the arrays are indexed
from 1.
Name
Score
1 2
1 98 1 Smithfield Tom
2 97 2 Johnson Jane
… …
YearSize 249 ←
Flag ←
TRUE
WHILE Flag = TRUE
Flag FALSE←
FOR Student ←
1 TO YearSize - 1
IF Score[Student] < Score[Student + 1] THEN
Temp1 ←
Score[Student]
Temp2 ←
Name[Student,1]
Temp3 ←
Name[Student,2]
Score[Student] Score[Student + 1] ←
Name[Student,1] Name[Student + 1,1] ←
Name[Student,2] Name[Student + 1,2] ←
Score[Student + 1] Temp1 ←
Name[Student + 1,1] Temp2 ←
Name[Student + 1,2] Temp3 ←
Flag TRUE ←
ENDIF
NEXT Student
ENDWHILE
Write an algorithm, using pseudocode, that will perform the same task using an insertion sort.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Identify the programming paradigm for each of these program code examples.
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (LK/CGW) 302515/4
© UCLES 2022 [Turn over
2
1 Real numbers are stored in a computer system using floating-point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
Mantissa Exponent
0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 0
...........................................................................................................................................
..................................................................................................................................... [1]
Mantissa Exponent
[2]
2 Outline the functions of the Transport and Internet layers of the TCP/IP protocol suite.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[5]
...................................................................................................................................................
............................................................................................................................................. [1]
...................................................................................................................................................
............................................................................................................................................. [1]
(c) The months of the year are: January, February, March, April, May, June, July, August,
September, October, November and December.
Write the pseudocode statement to define the data type Quarter1, to hold the names of the
first three months of a year.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(d) The composite data type Pet is used to store data about the various pets of a group of
students. It uses these fields:
(i) Write the pseudocode statement to set up a variable for one record of the composite
data type Pet.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Write pseudocode to store the details of the following pet, in the variable you set up in
part (d)(i).
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
4 Draw one line to connect each stage of compilation to its most appropriate description.
Lexical analysis
converting an intermediate representation of
source code into an executable form
Syntax analysis
converting a sequence of characters into a
sequence of tokens
Code generation
directly executing instructions written in a
scripting language
Optimisation
using parsing algorithms to interpret the
meaning of a sequence of tokens
[4]
a * b + b - d + 15
...................................................................................................................................................
............................................................................................................................................. [1]
a b - c d + * a /
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Evaluate your infix expression from part (b)(i) when a = 5, b = 10, c = 27 and d = 12.
...........................................................................................................................................
..................................................................................................................................... [1]
6 A message is encrypted using a private key and sent to an individual using asymmetric encryption.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Explain how a digital signature is used to verify a message when it is received.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
7 (a) Complete the Karnaugh map (K-map) for the Boolean expression.
Z = Ā. B. C̄. D̄ + Ā. B. C̄. D + A. B. C̄. D̄ + A. B. C̄. D + A. B̄. C̄. D̄ + A. B̄. C̄. D
AB
CD 00 01 11 10
00
01
11
10
[2]
(b) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal
sum-of-products. [2]
(c) Write the Boolean expression from your answer to part (b) as a simplified sum-of-products.
Use Boolean algebra to give your answer in its simplest form.
Simplified sum-of-products
Z = ............................................................................................................................................
Simplest form
Z = ............................................................................................................................................
[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) State one difference between paging and segmentation in the way memory is divided.
...................................................................................................................................................
............................................................................................................................................. [1]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
10 Reduced Instruction Set Computers (RISC) and Complex Instruction Set Computers (CISC) are
two types of processor.
(a) Tick (3) one box in each row to show if the statement applies to RISC or CISC processors.
(b) Describe the process of pipelining during the fetch-execute cycle in RISC processors.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
Instance ....................................................................................................................................
...................................................................................................................................................
Inheritance ................................................................................................................................
...................................................................................................................................................
Polymorphism ...........................................................................................................................
...................................................................................................................................................
[3]
Complete the pseudocode for the class Car to enable objects to be created. The class needs
to include:
• string attributes to store the make, model, body type and fuel type
• an integer attribute to store the number of cars of that type built.
The attributes must be available only through the methods of the class.
CLASS .....................................
PRIVATE ................................................................
................................................................................
................................................................................
................................................................................
.....................................................)
Make ← ......................................
Model ← ......................................
BodyType ← CarBodyType
Fuel ← ""
NumberBuilt ← 0
ENDPROCEDURE
GetFuel()
GetNumberBuilt()
.....................................
[5]
© UCLES 2022 9618/31/O/N/22
11
Lower ←0
......................................................................................................
Mid ← 0
Exit ← FALSE
OUTPUT "Enter the name to be found "
INPUT Target
REPEAT
....................................................................................................... THEN
Lower ←
.....................................................................................................
ENDIF
IF Names[Mid] > Target THEN
.....................................................................................................
ENDIF
...................................................................................................... THEN
OUTPUT Target, " was found at location ", Mid
Exit ← TRUE
ENDIF
......................................................................................................
[6]
The Big O notation for time complexity in a binary search is O(log n).
(i) State the Big O notation for time complexity of a linear search.
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (KS) 327186
© UCLES 2023 [Turn over
2
1 Numbers are stored in two different computer systems by using floating-point representation.
System 1 uses:
System 2 uses:
(a) Calculate the normalised floating-point representation of 113.75 and show how it would be
represented in each of these two systems.
System 1
Mantissa Exponent
System 2
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
(b) Explain the problem that occurred in part (a) when representing the number in system 2.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
2 (a) Draw one line from each machine learning category to its most appropriate description.
(b) Describe the purpose of both the A* algorithm and Dijkstra’s algorithm.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
3 (a) A hashing algorithm is used to calculate storage locations for records in a random access file.
It calculates hash values by using the function modulus 3.
1050
1025
[2]
(b) Describe what happens, in relation to the storage or retrieval of a record in the file, when
the calculated hash value is a duplicate of a previously calculated hash value for a different
record key.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
Give appropriate type declaration statements for each, including appropriate names.
(a) A data type to hold a set of prime numbers below 20. These prime numbers are:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A data type to point to a day in the week, for example Monday.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
5 (a) State, with a reason, where it would be appropriate to use circuit switching.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Benefit 1 ...................................................................................................................................
...................................................................................................................................................
Benefit 2 ...................................................................................................................................
...................................................................................................................................................
Drawback 1 ...............................................................................................................................
...................................................................................................................................................
Drawback 2 ...............................................................................................................................
...................................................................................................................................................
[4]
operator digit
+ 0
– 1
* 2
/ 3
symbol
$ 4
% 5
& 6
@ 7
# 8
letter 9
A
password
letter digit symbol
(a) State whether each of the following passwords is valid or invalid and give a reason for your
choice.
DPAD99$ ...................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
DAD#95 .....................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
ADY123? ...................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
[3]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.
...................................................................................................................................................
...................................................................................................................................................
[1]
(c) An identifier begins with one or more letters, followed by zero digits or one digit or more
digits.
Valid letters and digits are shown in the syntax diagrams on page 6.
[4]
7 (a) Complete the Karnaugh map (K-map) for the following Boolean expression.
AB
CD 00 01 11 10
00
01
11
10
[2]
(b) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal
sum-of-products. [2]
(c) Write the Boolean logic expression from your answer to part (b) as a simplified
sum-of-products.
Z = ............................................................................................................................................
............................................................................................................................................. [2]
(d) Use Boolean algebra to give your answer to part (c) in its simplest form.
Z = ...................................................................................................................................... [1]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [3]
9 (a) Encryption is used to alter data into a form that makes it meaningless if intercepted.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Benefit 1 ...................................................................................................................................
...................................................................................................................................................
Benefit 2 ...................................................................................................................................
...................................................................................................................................................
Drawback 1 ...............................................................................................................................
...................................................................................................................................................
Drawback 2 ...............................................................................................................................
...................................................................................................................................................
[4]
10 The pseudocode algorithm shown copies an active accounts text file ActiveFile.txt to an
archive accounts text file ArchiveFile.txt, one line at a time. Any blank lines found in the
active accounts text file are replaced with the words "Account not present" in the archive
accounts text file.
..........................................................................................................................................................
..........................................................................................................................................................
CLOSEFILE "ArchiveFile.txt"
[5]
11 Pseudocode is to be written to implement a queue Abstract Data Type (ADT) with items of the
string data type. This will be implemented using the information in the table.
A constant, with identifier MaxSize, limits the size of the queue to 60 items.
(a) Write the pseudocode to declare MaxSize, FrontPointer, RearPointer, Length and
Queue.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© UCLES 2023 9618/31/M/J/23
11
(b) Complete the following pseudocode for the function Dequeue to remove the front item from
the queue.
Item ← .......................................................................................................................
......................................................................................................................................
IF Length = 0 THEN
CALL Initialise // reset the pointers
ELSE
IF FrontPointer > MaxSize THEN
....................................................................................................................... ← 1
ENDIF
ENDIF
ELSE
OUTPUT "The print queue was empty – error!"
Item ← ""
ENDIF
RETURN Item
ENDFUNCTION
[4]
(c) Explain how a new element can be added to the queue if it is implemented using two stacks.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A Fibonacci sequence is a series of numbers formed by adding together the two preceding
numbers, for example:
0, 1, 1, 2, …
This function calculates and returns values in the Fibonacci sequence and uses recursion.
Complete the trace table for the function when it is called as Fib(5).
[5]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.