Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 1 of 3.
LibraryBook.Title ← "A Level Computer Science" LibraryBook.Fiction ← FALSE
Title assigned using LibraryBook.Title and the text in quotes [1]
Fiction assigned FALSE using LibraryBook.Fiction [1]
Use a range type for the field.
DECLARE NumberOfCopies : 1 .. 10
Range 1 .. 10 used in place of INTEGER [1]
One book can have many accession numbers, so use an array whose size is NumberOfCopies.
DECLARE AccessionNumber : ARRAY[1:NumberOfCopies] OF INTEGER
Array declared with the name AccessionNumber and bounds 1 to NumberOfCopies [1]
Array elements are of type INTEGER [1]
A user-defined composite data type is:
A data type made by the programmer, not a built-in (primitive) type [1]
It refers to at least one other data type, and these can be primitive or user-defined [1]
A correct example of another composite type, such as a class (object) or a set [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.