Skip to main content
O-LevelComputer ScienceAlgorithm design and problem-solving2210/23 · Oct/Nov 2024 · Q1215 Marks

Members of a litter picking group complete a litter pick every month. Members' names are stored in one-dimensional (1D) array PickerName[] Each member stores the weight of the litter they have picked in another one-dimensional (1D) array PickedWeight[] The weights are in kilograms with one decimal place, for example 8.4 The position of each member's data in the two arrays is the same. For example, the member stored at index 10 in PickerName[] and at index 10 in PickedWeight[] is the same. Every month, there is a small prize awarded to the members of the group who have the two heaviest weights. Certificates are awarded to all members with a pick weight of over three kilograms. Write a program that meets the following requirements: • allows the weight of members' picks to be input and validated • sorts the arrays PickedWeight[] and PickerName[] in descending order of weight • outputs the member names and the pick weights of the members with the two heaviest picks and identifies them as "Best in Group" and "Second best in Group" • stores the names of all the members who will receive a certificate in the array PickerCertificate[] • outputs a message stating the number of certificates to be printed. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables; you may assume that this has already been done. All inputs and outputs must contain suitable messages. You do not need to initialise the data in the array PickerName[]

Mark scheme

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

  1. AO2 (maximum 9 marks)
  2. AO3 (maximum 6 marks)
  3. Data Structures required names shown underlined must match those given in the scenario
  4. 2D Array or list PickerName[],PickedWeight[],PickerCertificate[]
  5. Variables
  6. Requirements (techniques)
  7. R1 Input and validate the weights (input and iteration)
  8. R2 sort the PickerName[],and PickedWeight[] arrays in descending order of weight (nested iteration and sorting)
  9. R3 Output top two members and the weights. Storing the members names who will receive a certificate and outputting the number of certificates (iteration, selection, assignment, counting and output with appropriate messages)
  10. Example 15-mark answer in pseudocode:
  11. CONSTANT GroupSize = 200 // setting the number of members in the club
  12. DECLARE Position : Array[1:2} OF STRING
  13. Position[1] ← "Best in Group"
  14. Position[2] ← "Second best in Group"
  15. FOR Index ← 1 TO GroupSize
  16. REPEAT
  17. PRINT "Please enter the weight for ", PickerName[Index],
  18. INPUT PickedWeight[Index]
  19. UNTIL PickedWeight[Index] > 0 AND PickedWeight[Index] < 15
  20. NEXT Index
  21. Last ← GroupSize
  22. REPEAT
  23. Swap ← FALSE
  24. FOR Index ← 1 TO GroupSize -1
  25. IF PickedWeight[Index] < PickedWeight[Index + 1]
  26. THEN
  27. TempWeight ← PickedWeight[Index]
  28. PickedWeight[Index] ← PickedWeight[Index + 1]
  29. PickedWeight [Index + 1] ← TempWeight
  30. TempName ← PickerName[Index]
  31. PickerName[Index] ← PickerName[Index + 1]
  32. PickerName[Index + 1] ← TempName
  33. Swap ← TRUE
  34. ENDIF
  35. NEXT Index
  36. Last ← Last - 1
  37. UNTIL NOT Swap or Last = 1
  38. FOR Index ← 1 TO 2
  39. OUTPUT Position[Index], PickerName[Index], " with a weight of ", PickedWeight[Index]
  40. NEXT Index
  41. Index ← 1
  42. Count ← 0
  43. WHILE PickedWeight[Index] > 3 DO // count number of certificates required and store names
  44. Count ← Count + 1
  45. PickerCertificate[Count] ← PickerName[Index]
  46. Index ← Index + 1
  47. ENDWHILE
  48. OUTPUT "Number of certificates to be printed is ", Count

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, 15 marks.
Source
O-Level Computer Science, Oct/Nov 2024 Paper 2 Variant 3, question 12.

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