Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 1 of 3.
TYPE Aircraft = (C300, C350, D242, E757, X380)
TYPE Aircraft = [1]
(C300, C350, D242, E757, X380) [1]
TYPE Flight
DECLARE FlightNumber : STRING
DECLARE Destination : STRING
DECLARE DepartureDate : DATE
DECLARE AircraftType : Aircraft
ENDTYPETYPE Flight and ENDTYPE correct [1]
FlightNumber (letters and numbers, so STRING) and Destination declared as STRING [1]
Departure date declared as DATE [1]
Aircraft type declared using the type Aircraft from part (a) [1]
DECLARE Flight1 : Flight
Variable declared with the type Flight [1]
Flight1.FlightNumber ← "XA782" Flight1.Destination ← "Cambridge" Flight1.DepartureDate ← 12/12/2022 Flight1.AircraftType ← C350
Both strings assigned in quotes [1]
Date assigned [1]
Enumerated value C350 assigned with no quotes [1]
▶ 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.