Computer Science · Oct / Nov 2024 · Paper 22 · Question 7
0478
As printed in the paper
The question as text
This pseudocode represents an algorithm. An input of –1 will terminate the algorithm. qsr qvzx qsr rz§¯w qsr }~ r ¶ }~ }~ rz§¯w }~ qvzx }~ u rz§¯w rz§¯w º qvzx qvzx ¶¶ rz§¯w ¶s }~
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
7(a)[5]
One mark per mark point (max five)
Correct Value columnCorrect Count columnCorrect Answer column (down to first OUTPUT (120)) – Shaded greyCorrect Answer column (remaining rows)Correct OUTPUT columnValue
Count
OUTPUT
5
5
4
20
3
60
2
120
1
120
120
6
6
5
30
4
120
3
360
2
720
1
720
720
−1
7(b)[1]
One mark for correct answer
Example:
It multiplies the input number by one less than itself repeatedly, until the value is 1It calculates the number of permutations of all the numbers up to the input value7(c)[2]
One mark per mark point (max two)
The program would accept the value and enter the FOR loopCount would keep reducing by 1 and would never reach 1, as it would already be less than 1There would be an endless loop
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

