9618/22/O/N/21 question 1: worked solution (October/November 2021, paper 22)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 11.1 Programming Basics Worked solution from the Programming Paper 2 Problem-solving and Programming booklet, Part 1 of 3. Q4 9618/22/O/N/21 original Q1 Structured · 11 marks Worked solution (a) Write any two of these points: Breaking a problem down into smaller parts / sub-problems [1] This makes the problem easier to understand and solve [1] It leads to program modules , or parts given to different people (this can score instead of the previous point) (b) Question Answer Number of dimensions of ThisArray 1 Terms for minimum and maximum of n lower bound, upper bound Term for the variable n index (or subscript) 1 dimension: one index is used [1] Lower bound and upper bound [1] Index [1] (c) Expression Evaluates to ASC('C') 67 2 * STR_TO_NUM("27") 54 INT(27 / 2) 13 "Sub" & MID("Abstraction", 4, 5) "Subtract" ASC gives the character code 67 [1] STR_TO_NUM turns "27" into 27, then 2 * 27 = 54 [1] 27 / 2 = 13.5 and INT gives 13 [1] Start at character 4 of "Abstraction" and take 5 characters: "tract", so MID , 4, 5 [1] Function names must be spelled exactly as in the insert. (d) Work out each expression with PumpOn = TRUE, PressureOK = TRUE, HiFlow = FALSE: Expression Evaluates to PressureOK AND HiFlow FALSE PumpOn OR PressureOK TRUE NOT PumpOn OR (PressureOK AND NOT HiFlow) TRUE NOT (PumpOn OR PressureOK) AND NOT HiFlow FALSE Any two rows correct [1] All four rows correct [1] KEY IDEA Decomposition splits a problem into smaller parts, and Boolean expressions are worked out by brackets first, then NOT, AND, OR. TOTAL 11 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by CS BY AQIB KHAN. Tap the picture to open it on YouTube.