Cambridge A2 Level Computer Science 9618 · 13.1 User-defined data types

Q2 · 9618/31/O/N/21 Q3

Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 1 of 3.

Q29618/31/O/N/21original Q3Structured · 4 marks
Question 3 from 9618/31/O/N/21

Worked solution

(a)

TYPE Parts = (Monitor, CPU, SSD, HDD, LaserPrinter, Keyboard, Mouse)

TYPE Parts = written correctly [1]

All seven values listed in brackets, separated by commas [1]

(b)

TYPE SelectParts = ^Parts

TYPE SelectParts = ^ (the ^ shows a pointer) [1]

The type it points to is Parts [1]

KEY IDEAAn enumerated type lists values; a pointer type is written with ^ followed by the type it points to.
TOTAL 4 marks

Official mark scheme

Mark scheme for 9618/31/O/N/21 question 3
VIDEO
▶ Whole paper

Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.