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

Q17 · 9618/32/M/J/25 Q1

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

Q179618/32/M/J/25original Q1Structured · 6 marks
Question 1 from 9618/32/M/J/25

Worked solution

(a)

Write the record name, a dot, then the field name, and use ← to assign. Text goes in quotes.

Flight1.FlightNumber ← "SB2789"
Flight1.Destination ← "Dublin"
Flight1.FlightDate ← 30/07/2025
Flight1.Gate ← "N03"
Flight1.Airline ← "Cambridge Airways"

Correct variable Flight1 used with the given field names [1]

The four string values assigned correctly [1]

The date value assigned correctly [1]

(b)(i)

List the codes in brackets.

TYPE GateID = (N01, N02, N03, W01, W02, W03, W04)

TYPE GateID = [1]

All seven codes in brackets [1]

(b)(ii)

The field now has the new type.

DECLARE Gate : GateID

Correct declaration of Gate with type GateID [1]

KEY IDEAUse variable.field with ← to fill a record, and an enumerated type lists all its allowed values in brackets.
TOTAL 6 marks

Official mark scheme

Mark scheme for 9618/32/M/J/25 question 1
VIDEO
▶ Topic lesson

A lesson on this topic · by ZAINEMATICS. 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.