May/June 2026 Paper 23

2026 · 8 questions · 27 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong27Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
7(a)(i)Algorithms Pseudocode FlowchartsMedium4 marks
Study the pseudocode algorithm. Numbers will be copied into the Data array.
pseudocode
// STAGE 1Num1 ← 12Index ← 1FOR i ← 2 TO Num1 DIV 2   IF Num1 MOD i = 0 THEN      Data[Index] ← i      Index ← Index + 1   ENDIFNEXT iIndex ← Index - 1OUTPUT Index, " values were found"
Complete the trace table for STAGE 1
Num1IndexiData[1]Data[2]Data[3]Data[4]
7(a)(ii)Algorithms Pseudocode FlowchartsEasy1 mark
State how the numbers in the Data array are related.
7(b)(i)Algorithms Pseudocode FlowchartsMedium3 marks
The complete algorithm has a second stage.
pseudocode
// STAGE 2Num2 ← 8Match ← FALSEREPEAT   IF Num2 MOD Data[Index] = 0 THEN      Match ← TRUE   ELSE      Index ← Index - 1   ENDIFUNTIL Match = TRUE OR Index = 0IF Match = TRUE THEN   OUTPUT Data[Index]ELSE   OUTPUT "Nothing found"ENDIF
One line of the STAGE 1 code is changed:
pseudocode
Num1 ← 20
The programmer creates a final program with the STAGE 1 code followed immediately by the STAGE 2 code. The STAGE 1 trace table shows the relevant final variable values after the completion of STAGE 1:
Num1IndexData[1]Data[2]Data[3]Data[4]
20424510
This is followed by running of the STAGE 2 code. Complete the trace table for STAGE 2
Num1Num2IndexMatchData[1]Data[2]Data[3]Data[4]
20
4
24510
7(b)(ii)Algorithms Pseudocode FlowchartsEasy1 mark
State the purpose of the STAGE 2 algorithm.