9618/21/O/N/25 question 3: worked solution (October/November 2025, paper 21)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 10.1 Data Types and Records Worked solution from the Data Types and Structures Paper 2 Problem-solving and Programming booklet, Part 1 of 4. Q8 9618/21/O/N/25 original Q3 Structured · 9 marks Worked solution (a)(i) Declare each item with a name and a data type inside TYPE ... ENDTYPE. TYPE RentalRecord DECLARE RentalID : STRING DECLARE CarID : INTEGER DECLARE DisCode : CHAR DECLARE Start : DATE DECLARE Duration : INTEGER DECLARE Completed : BOOLEAN ENDTYPE TYPE RentalRecord and ENDTYPE [1] RentalID as STRING and CarID as INTEGER [1] DisCode as CHAR and Start as DATE [1] Duration as INTEGER and Completed as BOOLEAN [1] (a)(ii) DECLARE Rental : ARRAY[1:500] OF RentalRecord An array with 500 elements, for example ARRAY[1:500] [1] Of type RentalRecord [1] (b) Any three of these: Items of different data types are held for each rental under a single identifier [1] The rentals can be reached in a loop , or one rental directly using an index [1] The program is simpler: less code, easier to understand, test and maintain [1] KEY IDEA A record groups items of different types; an array of records lets you store, index and loop through many such records. TOTAL 9 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by CSFeedbySirNisarAli. Tap the picture to open it on YouTube.