Skip to main content
A-LevelComputer ScienceProgramming9618/22 · May/June 2022 · Q76 Marks

A programming language has string functions equivalent to those given in the insert. The language includes a LEFT() and a RIGHT() function, but it does not have a MID() function.

  1. (a)Write pseudocode for an algorithm to implement your own version of the MID() function which will operate in the same way as that shown in the insert. Do not use the MID () function given in the insert, but you may use any of the other functions. Assume that the values passed to the function will be correct.[4]
  2. (b)The values passed to your MID () function in part (a) need to be validated. Assume that the values are of the correct data type. State two checks that could be applied to the values passed to the function. 1 2[2]

Mark scheme

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

  1. [4] Marks as follows:
  2. 1 Function heading and ending including parameters and return type
  3. 2 Correct use of one substring functions
  4. 3 Correct use of both substring functions (in correct sequence)
  5. 4 Return substring after a reasonable attempt
  6. [2] One mark per point
  7. Check that:
  8. • Start and/or Num are >= 1 // positive
  9. • Length of InString is "sufficient" for required operation

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
Programming, A-Level Computer Science (syllabus 9618). Structured question, 6 marks.
Source
A-Level Computer Science, May/June 2022 Paper 2 Variant 2, question 7.

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