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

Q20 · 9618/32/O/N/25 Q1

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

Q209618/32/O/N/25original Q1Structured · 6 marks
Question 1 from 9618/32/O/N/25

Worked solution

(a)(i)

Declare a variable and give it the record type's name.

DECLARE Car1 : Car

DECLARE with a variable name and the type Car [1]

(a)(ii)

Use dot notation: variable name, a dot, then the field name.

Car1.Colour ← "Blue"
Car1.IntoStock ← 21/10/2025

Colour assigned "Blue" using Car1.Colour [1]

IntoStock assigned 21/10/2025 using Car1.IntoStock [1]

(b)(i)

An enumerated type lists its values in brackets after TYPE and the name.

TYPE Body = (Convertible, Hatchback, Saloon, SUV)

TYPE Body = [1]

The four values in brackets, separated by commas [1]

(b)(ii)

Change BodyStyle in the record so its type is Body instead of STRING.

DECLARE BodyStyle : Body

DECLARE BodyStyle : Body [1]

KEY IDEAA record variable is declared with its type name and its fields are reached with dot notation; an enumerated type lists its values in brackets.
TOTAL 6 marks

Official mark scheme

Mark scheme for 9618/32/O/N/25 question 1
VIDEO
▶ Whole paper

Video solution of the whole paper · by Zafar Ali Khan (ZAK). 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.