Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 1 of 3.
A non-composite data type is defined without referring to another data type. [1]
It can be a primitive data type or a user-defined data type. [1]
Example: an enumerated type, for example TYPE Season = (Spring, Summer, Autumn, Winter), or a pointer type. [1]
A set type is declared with TYPE, then a variable of that type is given its values with DEFINE.
TYPE Numbers = SET OF INTEGER DEFINE EvenNumbers (2, 4, 6, 8, 10, 12) : Numbers
TYPE statement fully correct (TYPE Numbers = SET OF INTEGER) [1]
DEFINE EvenNumbers [1]
Correct list of values in brackets [1]
Type name written after the colon [1]
Any sensible name for the type is accepted, as long as it is used after the colon.
▶ Starts at Q3 (18:09)
Starts at Q3 (18:09) · by Pseudocode Pro. 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.