Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 1 of 3.
TYPE Spectrum = (Red, Orange, Yellow, Green, Blue, Indigo, Violet)
TYPE Spectrum = [1]
All seven colours in brackets, separated by commas [1]
Write any two of these:
The list is ordered (each value has a position, so values can be compared) [1]
The list holds all the possible values the type can take [1]
Other points that score: there are no duplicate values, and all the values are of the same data type.
Start with TYPE and the name, DECLARE each field with the most suitable type, and end with ENDTYPE.
TYPE ColourData
DECLARE ColourCode : STRING
DECLARE Colour : Spectrum
DECLARE Wavelength : INTEGER
DECLARE Frequency : REAL
DECLARE PrimaryColour : BOOLEAN
ENDTYPETYPE ColourData and ENDTYPE [1]
DECLARE used for every field [1]
Colour declared with the type Spectrum [1]
ColourCode as STRING, Wavelength as INTEGER, Frequency as REAL, PrimaryColour as BOOLEAN [1]
▶ 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.