9618/32/O/N/25 question 1: worked solution (October/November 2025, paper 32)

Show as plain text

Cambridge A2 Level Computer Science 9618 · 13.1 User-defined data types Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 1 of 3. Q20 9618/32/O/N/25 original Q1 Structured · 6 marks Worked solution (a)(i) Declare a variable and give it the record type's name. DECLARE Car1 : Car DECLARE with a variable name and the type Car [1] (a)(ii) Use dot notation: variable name, a dot, then the field name. Car1.Colour ← "Blue" Car1.IntoStock ← 21/10/2025 Colour assigned "Blue" using Car1.Colour [1] IntoStock assigned 21/10/2025 using Car1.IntoStock [1] (b)(i) An enumerated type lists its values in brackets after TYPE and the name. TYPE Body = (Convertible, Hatchback, Saloon, SUV) TYPE Body = [1] The four values in brackets, separated by commas [1] (b)(ii) Change BodyStyle in the record so its type is Body instead of STRING. DECLARE BodyStyle : Body DECLARE BodyStyle : Body [1] KEY IDEA A record variable is declared with its type name and its fields are reached with dot notation; an enumerated type lists its values in brackets. TOTAL 6 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.