An examination 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. A program is being written to process examination marks. The five grade boundaries are stored in a global 1D array GB of type INTEGER, for example: Index | Value | Comment ---|---|--- 1 | 65 | The minimum mark for an A grade. 2 | 57 | The minimum mark for a B grade. 3 | 43 | The minimum mark for a C grade. 4 | 35 | The minimum mark for a D grade. 5 | 27 | The minimum mark for an E grade. Any paper that achieves a mark within 2 marks of a grade boundary must be checked. Using the given table, a paper with 45 marks would need to be checked.
- (a)The pseudocode algorithm to determine whether a paper should be checked is as shown. The mark for the paper is stored in variable Mark. Global variables Mark, Index, Upper and Lower are declared as integers. Complete the pseudocode. FOR Index ← 1 TO Lower ← GB[Index] – 2 Upper ← IF Mark OUTPUT "Check this paper" ENDIF NEXT Index[4]
- (b)(i)An alternative algorithm to determine if a paper needs to be checked uses a global 1D array Check, containing 76 elements of type BOOLEAN. The indices of the array are from 0 to 75 (inclusive), corresponding to the range of possible marks. An element value in Check is TRUE if the index is within 2 marks of a grade boundary. For example, in the case where the C grade boundary is 43 the corresponding part of the Check array would be as follows: Index | Value ---|--- 40 | FALSE 41 | TRUE 42 | TRUE 43 | TRUE // The grade boundary for a C grade 44 | TRUE 45 | TRUE 46 | FALSE The mark for a given paper is stored in variable Mark. Describe how an algorithm would use the Check array to determine whether this paper should be checked.[2]
- (b)(ii)A procedure GBInitialise () will initialise the Check array using values from the GB array. Note it can be assumed that the maximum grade boundary value for A is 70 and the minimum value for E is 15. Write pseudocode for the procedure.[6]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2024). The mark or mark type is shown in brackets.
- [1] FOR Index ← 1 TO 5
- [1] Upper ← GB[Index] + 2 // Lower + 4
- [1] IF Mark >= Lower AND Mark <= Upper THEN
- [1] //IF Mark <= Upper AND Mark >= Lower THEN
- [1] MP1 Use Mark as the index to the Check array // to specify an array element
- [1] MP2 If value of indexed element is TRUE, then the paper will need to be checked
- [1] MP1 Procedure heading and ending
- [1] MP2 Initialise Check array to FALSE
- [1] MP3 Loop through GB array
- [1] MP4 Extract the GB mark
- [1] MP5 Loop for 5 elements across GBMark ± 2 // Check if within GBMark +2
- [1] MP6 Assign each element of Check array to TRUE
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 →