9618/31/O/N/25 question 1: worked solution (October/November 2025, paper 31)
Show as plain textHide 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. Q19 9618/31/O/N/25 original Q1 Structured · 6 marks Worked solution (a)(i) Declare a variable whose type is the record type. DECLARE Member1 : ClubMember Correct declaration [1] (a)(ii) Use the variable name, a dot and the field name. No quotes for a number or TRUE. Member1.Code ← 984632 Member1.FeesPaid ← TRUE Code assigned correctly [1] FeesPaid assigned correctly [1] (b)(i) List the activities in brackets. TYPE Activity = (Badminton, Football, Golf, Snooker, Swimming, Tennis) TYPE Activity = [1] All six activities in brackets [1] (b)(ii) The new field uses the enumerated type. DECLARE Choice : Activity Correct declaration of Choice with type Activity [1] KEY IDEA Declare a variable of the record type, set fields with variable.field ← value, and use an enumerated type for a fixed list of choices. 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.