Computer Science (9618) · Oct/Nov 2023 · Question paper 32

Cambridge Computer Science (9618) question paper for paper 32, Oct/Nov 2023 — 9618/32/O/N/23, file 9618_w23_qp_32.pdf.

Advertisement
Loading the paper…
Text of this paper

www.dynamicpapers.com

Cambridge International AS & A Level

* 5 5 6 9 4 6 3 9 9 4 *

COMPUTER SCIENCE

9618/32

Paper 3 Advanced Theory

October/November 2023
1 hour 30 minutes

You must answer on the question paper.
No additional materials are needed.
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.

This document has 16 pages. Any blank pages are indicated.
DC (EF/CT) 318340/2
© UCLES 2023

[Turn over

2
1

www.dynamicpapers.com

(a) Real numbers are stored in a computer using floating point representation with:

•
•
•

10 bits for the mantissa
6 bits for the exponent
two’s complement form for both the mantissa and the exponent.

Write the normalised floating‑point representation of –96.75 in this system.
Show your working.
Mantissa

Exponent

Working

[3]
(b) Explain why a binary representation is sometimes only an approximation to the real number it
represents.

[3]

© UCLES 2023

9618/32/O/N/23

3
2

www.dynamicpapers.com

Describe what is meant by composite and non‑composite data types.
Composite

Non‑composite

[4]

3

The location of a record in a random file is determined using a hashing algorithm.
A collision may occur during the process of adding a record.
(a) Outline what is meant by the term collision in this context.

[2]
(b) Explain how a collision can be dealt with when writing records to a random file.

[3]

© UCLES 2023

9618/32/O/N/23

[Turn over

4
4

www.dynamicpapers.com

Complete the following paragraph about a protocol suite, using words from the given list.
Some words are not used.
BitTorrent

circuit switching

layered

link

peer‑to‑peer

queue

stack

star

list
TCP/IP

The protocols in a determine the interconnectivity
rules for a network model such as the
model.

5

[3]

(a) Outline the reasons why an operating system may need to use virtual memory.

[2]
(b) Explain the circumstances in which disk thrashing could occur.

[3]

© UCLES 2023

9618/32/O/N/23

5
6

www.dynamicpapers.com

(a) The Reverse Polish Notation (RPN) expression:

a b * 2 / c d / *
is to be evaluated where a = 20, b = 3, c = 10 and d = 5.
Show the changing contents of the following stack as the RPN expression is evaluated.

[4]
(b) Explain how an expression stored in RPN can be evaluated.

[3]

© UCLES 2023

9618/32/O/N/23

[Turn over

www.dynamicpapers.com

6
7

(a) This logic circuit represents the Boolean expression: X = A + B + C
A
X

B
C
Complete this truth table for the given logic circuit.

A

B

C

0

0

0

0

0

1

0

1

0

0

1

1

1

0

0

1

0

1

1

1

0

1

1

1

X

[1]
(b) Apply De Morgan’s laws to the expression: X = A + B + C
X = [1]
(c) Simplify the following expression using Boolean algebra.
Show all the stages in your simplification.
T = X.Y.Z + X.Y.Z + X

[3]
© UCLES 2023

9618/32/O/N/23

www.dynamicpapers.com

7
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

A

8

B

2

C

3

8

9
D
2
E
7
10

Start

F

Working

Answers:
A

B

C

D

E

F

[5]
© UCLES 2023

9618/32/O/N/23

[Turn over

8
9

www.dynamicpapers.com

(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.
A 1D array Stack stores the contents of the stack.
(i)

Study the pseudocode in part (a)(ii) and complete the table of identifiers by writing the
missing data types and descriptions.
Identifier

Data type

Description

BasePointer
TopPointer
Stack

REAL
[2]

(ii)

Complete the pseudocode.
CONSTANT MaxSize = 40

DECLARE BasePointer : INTEGER
DECLARE TopPointer : INTEGER

DECLARE Stack : ARRAY[1:40] OF REAL
// initialisation of stack
PROCEDURE Initialise()

1

0

ENDPROCEDURE
// push an item onto the stack
PROCEDURE Push(NewItem : REAL)

MaxSize THEN

Stack[TopPointer]

ENDIF

ENDPROCEDURE

© UCLES 2023

[5]

9618/32/O/N/23

9

www.dynamicpapers.com

(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]
10 Describe the features of the SIMD and MISD computer architectures.
SIMD

MISD

[4]

© UCLES 2023

9618/32/O/N/23

[Turn over

10
11

www.dynamicpapers.com

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).
These clauses have the meanings:
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.
Write additional clauses to represent this information.
20
21
22
23
[4]

© UCLES 2023

9618/32/O/N/23

11

www.dynamicpapers.com

(b) Using the variable P, the goal:
enjoys(P, camping)
returns
P = elijah, joseph
Write the result returned by the goal:
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.
Write this as a rule.
might_enjoy(N, H)
IF

[4]
12 (a) Describe, with an example, what is meant by an exception.

[2]

© UCLES 2023

9618/32/O/N/23

[Turn over

www.dynamicpapers.com

12

(b) A pseudocode algorithm searches for a customer record
AccountRecord.dat. A user inputs the name of the customer.

in

a

random

file

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

If the record is found, it is output, otherwise an error message is displayed.
Complete the file handling pseudocode.
DECLARE Customer : TAccount
DECLARE Location : INTEGER
DECLARE MaxSize : INTEGER

DECLARE FoundFlag : BOOLEAN

DECLARE SearchCustomer : STRING
MaxSize

1000

OPENFILE
Location

1

OUTPUT "Enter the customer’s name"

FALSE

AND Location <= MaxSize
"AccountRecord.dat",

GETRECORD "AccountRecord.dat", Customer
IF SearchCustomer = Customer.Name THEN
OUTPUT "Customer found: "
OUTPUT Customer
FoundFlag

ENDIF

Location

ENDWHILE

TRUE

// output customer record

Location + 1

IF NOT FoundFlag THEN
OUTPUT " "

ENDIF
© UCLES 2023

[7]
9618/32/O/N/23

13
BLANK PAGE

© UCLES 2023

9618/32/O/N/23

www.dynamicpapers.com

14
BLANK PAGE

© UCLES 2023

9618/32/O/N/23

www.dynamicpapers.com

15
BLANK PAGE

© UCLES 2023

9618/32/O/N/23

www.dynamicpapers.com

16

www.dynamicpapers.com

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.

© UCLES 2023

9618/32/O/N/23

Advertisement