Skip to main content
A-LevelComputer ScienceData types and structures9618/21 · Oct/Nov 2024 · Q815 Marks

An exam paper has a maximum of 75 marks. One of five pass grades (A to E) is assigned, depending on the mark obtained. The lowest mark for a given grade is known as the grade boundary. For example, if the grade boundary for an A grade is 65 marks, then any candidate who achieves a mark of 65 or above will be awarded an A. A grade of U is awarded for marks below the E grade boundary. The five grade boundaries are stored in a global 1D array GradeBoundary of type integer. For example: Element | Value | Comment ---|---|--- GradeBoundary[1] | 65 | The minimum mark for an A grade. GradeBoundary[2] | 57 | The minimum mark for a B grade. GradeBoundary[3] | 43 | The minimum mark for a C grade. GradeBoundary[4] | 35 | The minimum mark for a D grade. GradeBoundary[5] | 27 | The minimum mark for an E grade. A global 2D array Result of type integer contains candidate marks for the exam. Each row relates to one candidate. Column 1 contains the candidate mark and column 2 contains the unique candidate ID. For example, for the fourth and fifth candidates: Element | Mark | Element | ID ---|---|---|--- Result[4, 1] | 56 | Result[4, 2] | 1074832 Result[5, 1] | 54 | Result[5, 2] | 2573839 There are more rows in the array than candidates who sit the exam. Any unused rows will be at the end of the array. Candidate papers that are given a mark within two marks of any grade boundary must be checked. For example, given the values in the example grade boundaries above, any paper that was awarded between 41 and 45 marks (inclusive) would need to be checked. A program is being written to identify papers that need to be checked. The programmer has defined the first program module as follows: Module | Description ---|--- CheckMark() | • called with a parameter of type integer representing a candidate mark | • returns TRUE if the mark is within 2 of any of the five grade boundaries, otherwise returns FALSE

  1. (a)Write pseudocode for module CheckMark().[6]
  2. (b)A second module is defined: Module | Description ---|--- CheckAll() | • called with a parameter of type integer representing the number of candidate marks in the Result array | • uses CheckMark() to check each candidate mark | • for each paper that needs to be checked, write the corresponding candidate ID on a separate line in a new file named GRList.txt | • outputs a message with a count of how many papers need to be checked Write pseudocode for module CheckAll(). CheckMark () must be used to check each individual mark.[8]
  3. (c)The requirement changes. Instead of a new file, the module described in part (b) needs to add the corresponding candidate ID for each paper that needs to be checked to an existing file. Explain the change that will need to be made to CheckAll().[1]

Mark scheme

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

  1. [1] (a) Loop through all elements in GradeBoundary array
  2. [1] (a) Attempt to calculate range, both Lower and Upper, in a loop
  3. [1] (a) Completely correct range calculation in a loop
  4. [1] (a) Test if given mark / parameter, is within range in a loop
  5. [1] (a) Set variable / immediate RETURN if recheck required in a loop
  6. [1] (a) Return Boolean in both cases following a reasonable attempt
  7. FUNCTION CheckMark(Mark : INTEGER) RETURNS BOOLEAN
  8. DECLARE Index, Lower, Upper : INTEGER
  9. FOR Index ← 1 TO 5
  10. Lower ← GradeBoundary[Index] – 2
  11. Upper ← GradeBoundary[Index] + 2
  12. IF Mark >= Lower AND Mark <= Upper THEN
  13. RETURN TRUE
  14. ENDIF
  15. NEXT Index
  16. RETURN FALSE
  17. ENDFUNCTION
  18. [1] (b) Procedure heading, parameter and ending.
  19. [1] (b) Open file in write mode and subsequently close
  20. [1] (b) Loop through all CNum candidates
  21. [1] (b) Extract candidate mark from Result array in a loop
  22. [1] (b) Use of CheckMark() with candidate mark as parameter in a loop
  23. [1] (b) Test return value and if TRUE then increment Count in a loop
  24. [1] (b) write ID to file
  25. [1] (b) after conversion to a string in a loop
  26. [1] (b) Final output of message giving number of papers to check not in a loop
  27. PROCEDURE CheckAll(CNum : INTEGER)
  28. DECLARE Index, Count, ThisMark: INTEGER
  29. Count ← 0
  30. OPENFILE "GRList.txt" FOR WRITE
  31. FOR Index ← 1 to CNum
  32. ThisMark ← Result[Index, 1]
  33. IF CheckMark(ThisMark) = TRUE THEN
  34. WRITE "GRList.txt", NUM_TO_STR(Result[Index, 2])
  35. Count ← Count + 1
  36. ENDIF
  37. NEXT Index
  38. CLOSEFILE "GRList.txt"
  39. OUTPUT "There are ", Count, " papers to check"
  40. ENDPROCEDURE
  41. [1] (c) The file will need to be opened in APPEND mode

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
Data types and structures, A-Level Computer Science (syllabus 9618). Structured question, 15 marks.
Source
A-Level Computer Science, Oct/Nov 2024 Paper 2 Variant 1, question 8.

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