2210/22/O/N/23 question 3: worked solution (October/November 2023, paper 22)

Show as plain text

Cambridge O Level Computer Science 2210 · 8.1 Programming concepts Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 1 of 3. Q22 2210/22/O/N/23 original Q3 Structured · 8 marks Worked solution (a) Draw these four lines: CALL Colour(NewColour) → using a procedure [1] Value ← (A1 + A2 + A3) / 3 → finding an average [1] Loop1 ← Loop1 + 1 → counting [1] IF Count > 7 THEN X1 ← 0 → using a conditional statement [1] Totalling is not needed. (b) Start the lowest value high, then check each of the 25 elements and keep the smaller one. Min ← 100 FOR Count ← 1 TO 25 IF Temperatures[Count] < Min THEN Min ← Temperatures[Count] ENDIF NEXT Count OUTPUT "The lowest temperature is ", Min Lowest value set to a high value (at least 100) or the first element before the loop [1] Loop that runs 25 times [1] IF checks whether the element is less than the current lowest, and if so stores it as the lowest [1] Result output once, after the loop, with a message [1] KEY IDEA Start with a very high lowest value, compare every element inside one loop and output only after the loop. TOTAL 8 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Paper solver.. Tap the picture to open it on YouTube.