Computer Science · Oct / Nov 2022 · Paper 22 · Question 6
2210
As printed in the paper
The question as text
This flowchart represents an algorithm to divide three-digit numbers into hundreds, tens and units. The pre-defined function DIV gives the value of the result of integer division, for example Y = 9 DIV 4 gives the value Y = 2 The pre-defined function MOD gives the value of the remainder of integer division, for example R = 9 MOD 4 gives the value R = 1 START IS Counter > 7? STOP Yes No INPUT Number OUTPUT "Hundreds: ", Hundreds, " Tens: ", Tens, " Units: ", Units Counter 0 IS Number < 100? Yes No IS Number > 999? Yes No Counter Counter + 1 Hundreds Number DIV 100 Temp Number MOD 100 Tens Temp DIV 10 Units Number MOD 10 11 Complete the trace table for the algorithm using this input data: 97, 876, 4320, 606, 9875, 42, 124 Counter Number Hundreds Temp Tens Units OUTPUT [5]
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

