Note AcademyNote Academy

Computer Science · Oct / Nov 2025 · Paper 23 · Question 7

2210

As printed in the paper

The question as text

An algorithm has been written in pseudocode to: • input a whole number between 1 and 255 inclusive • convert the input to an 8-bit binary number • store each bit of the binary number in an array. For example, if the denary number 127 was input, the binary number 01111111 would be stored in the array. 01 DECLARE BinaryArray : ARRAY[1:8] OF INTEGER 02 DECLARE DenaryNumber : CHAR 03 OUTPUT "Please enter a whole number between 1 and 255 inclusive " 04 INPUT DenaryNumber 05 FOR Count 7 TO 1 STEP -1 06 BinaryArray[Count] MOD(DenaryNumber,3) 07 DenaryNumber DIV(DenaryNumber,2) 08 NEXT Count

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 7(a)[3]

  • 7(b)[1]

  • 7(c)(i)[1]

  • 7(c)(ii)[3]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.