9618/23/O/N/25 question 1: worked solution (October/November 2025, paper 23)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 11.3 Structured Programming Worked solution from the Programming Paper 2 Problem-solving and Programming booklet, Part 3 of 3. Q93 9618/23/O/N/25 original Q1 Structured · 10 marks Worked solution (a) Write any three of these: Library routines are tried and tested , so they are free from errors. [1] They are readily available , which speeds up development. [1] They are updated automatically when improved, so no maintenance is needed. [1] The algorithm will follow the international standard . (Also accepted for the third mark.) (b)(i) Write any two of these: The subroutine does one specific task . [1] The code is used in several places so it is written once. [1] Testing, debugging or maintenance is easier . (Also accepted.) (b)(ii) Term Description Pass2 the name of the function Count the parameter passed to the function BOOLEAN the data type of the value the function returns Count described as the parameter [1] BOOLEAN described as the return type [1] (c) LENGTH of "2.5" is 3. MONTH(DoB) is 6, and 6 > 4 is TRUE. The 2nd character of the address is "5", so 15 + 5 = 20. Expression Evaluates to LENGTH(NUM_TO_STR(Multiplier)) 3 MONTH(DoB) > 4 TRUE 15 + STR_TO_NUM(MID(AddressLine [1] , 2, 1)) 20 3 [1] TRUE [1] 20 [1] KEY IDEA Library routines save time and are already tested; subroutines avoid repeated code and make testing easier. TOTAL 10 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by ZAINEMATICS. Tap the picture to open it on YouTube.