9618/22/O/N/25 question 7: worked solution (October/November 2025, paper 22)

Show as plain text

Cambridge AS Level Computer Science 9618 · 12.2 Program Design Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3. Q31 9618/22/O/N/25 original Q7 Structured · 6 marks Worked solution (a) Write what the curved arrow shows, using the module names: It shows repetition (iteration) [1] Convert repeatedly calls Analyse, then Update, then Sort , in that order [1] (b) Count goes into Analyse and does not come back, so it is a procedure. Update takes Key (STRING) and gives back T1 (the number of elements, so INTEGER), so it is a function. P2 has a filled circle (a flag, so BOOLEAN) and goes both ways, so it is passed by reference. PROCEDURE Analyse(Count : INTEGER) FUNCTION Update(Key : STRING) RETURNS INTEGER PROCEDURE Sort(BYREF P2 : BOOLEAN) Analyse as a PROCEDURE with parameter Count : INTEGER [1] Update as a FUNCTION with parameter Key : STRING [1] Update RETURNS INTEGER [1] Sort as a PROCEDURE with BYREF P2 : BOOLEAN [1] KEY IDEA Read a structure chart to decide procedure or function, then write each header with its parameters, BYREF where the data goes both ways, and RETURNS where a value comes back. TOTAL 6 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by MAK CS. Tap the picture to open it on YouTube.