9618/33/M/J/25 question 1: worked solution (May/June 2025, paper 33)
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. Q18 9618/33/M/J/25 original Q1 Structured · 6 marks Worked solution (a) Use STRING for the code and format, INTEGER for the year and running time, and DATE for the date. TYPE VideoLibrary DECLARE VideoID : STRING DECLARE Title : STRING DECLARE ReleaseYear : INTEGER DECLARE PurchaseDate : DATE DECLARE VideoFormat : STRING DECLARE RunningTime : INTEGER ENDTYPE TYPE VideoLibrary and ENDTYPE correct [1] DECLARE used correctly for every field [1] The three STRING fields correct [1] The remaining three fields correct [1] (b) Field: VideoFormat [1] Reason: it can only have a fixed set of possible values (such as DVD, Blu-ray, 4K, MP4) [1] KEY IDEA A field with a small fixed list of allowed values is a good choice for an enumerated type. TOTAL 6 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by ZAINEMATICS. Tap the picture to open it on YouTube.