Skip to main content
O-LevelComputer ScienceAlgorithm design and problem-solving2210/22 · May/June 2024 · Q68 Marks

Totalling and counting are standard methods of solution. Numbers are input. The number 9999.9 is the last number to be input and is ignored.

  1. (a)Write an algorithm in pseudocode to total the numbers input and to output the total. You do not need to validate the input.[4]
  2. (b)Write an algorithm in pseudocode to count and output the number of input values that are greater than 100. You do not need to validate the input.[4]

Mark scheme

Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.

  1. One mark for:
  2. MP1 adding current value to total
  3. One mark for each point max three.
  4. MP2 input more than one number
  5. MP3 setting total to zero before loop
  6. MP4 correct use of loop including terminal condition
  7. MP5 output total after loop
  8. Example:
  9. Total ← 0
  10. INPUT Value
  11. WHILE Value <> 9999.9
  12. Total ← Total + Value
  13. INPUT Value
  14. ENDWHILE
  15. OUTPUT Total
  16. Value ← 0
  17. Total ← 0
  18. REPEAT
  19. Total ← Total + Value
  20. INPUT Value
  21. UNTIL Value = 9999.9
  22. OUTPUT Total
  23. One mark for each point
  24. MP1 adding one to counter
  25. MP2 correct use of selection, if current value > 100 THEN ... ENDIF
  26. One mark for each point, max two
  27. MP3 input more than one number
  28. MP4 setting counter to zero before loop
  29. MP5 correct use of loop including terminal condition
  30. MP6 output value of counter after loop
  31. Example:
  32. Counter ← 0
  33. INPUT Value
  34. WHILE Value <> 9999.9
  35. IF Value > 100
  36. THEN
  37. Counter ← Counter + 1
  38. ENDIF
  39. INPUT Value
  40. ENDWHILE
  41. OUTPUT Counter

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Algorithm design and problem-solving, O-Level Computer Science (syllabus 2210). Structured question, 8 marks.
Source
O-Level Computer Science, May/June 2024 Paper 2 Variant 2, question 6.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep