Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 1 of 3.
Write about both kinds of data type. Any three of these, but no more than two for each kind:
Non-composite types can be primitive or user-defined. [1]
Non-composite types do not refer to other data types in their definition (they contain one data type). [1]
Non-composite types can be primitive, enumerated or pointer types. (also credited, but no extra mark: any n only)
Composite types can be primitive or user-defined. [1]
Composite types refer to other data types in their definition (they contain more than one data type). (also credited, but no extra mark: any n only)
Composite types can be record, set or class types. (also credited, but no extra mark: any n only)
A record is declared between TYPE and ENDTYPE, with one DECLARE for each field.
TYPE FootballClub
DECLARE TeamName : STRING
DECLARE DateOfJoining : DATE
DECLARE MainTelephone : STRING
DECLARE ManagerName : STRING
DECLARE NumberOfMembers : INTEGER
DECLARE LeaguePosition : INTEGER
ENDTYPETYPE FootballClub and ENDTYPE written correctly [1]
First two fields declared correctly [1]
Next two fields declared correctly [1]
Last two fields declared correctly [1]
Other sensible identifiers and data types are accepted, for example the telephone number as a STRING.
▶ Whole paper
Video solution of the whole paper · by CsWithMym. 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.