Skip to main content
A-LevelComputer ScienceFurther programming9618/23 · Oct/Nov 2023 · Q66 Marks

A function TestNum() will take a six-digit string as a parameter. The function will test whether the string meets certain conditions and will return an integer value as follows: Return value | Condition | Example -------------|----------------------------------------------|---------- 1 | The last three digits are the same but non-zero. | "253444" 2 | The last three digits are zero. | "253000" 3 | The first three and last three digits are the same. | "410410" The function will return the highest possible value for the given string. If the string does not meet any of the conditions, zero is returned.

  1. Write pseudocode for function TestNum(). Assume that the parameter is valid.[6]

Mark scheme

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

  1. 6 MP1 Function heading and ending including parameter and return type
  2. 6 MP2 Test for Condition 1
  3. 6 MP3 Test for Condition 2
  4. 6 MP4 Test for Condition 3
  5. 6 MP5 Return the highest value if more than one condition is satisfied
  6. 6 MP6 Return zero if no condition matched

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
Further programming, A-Level Computer Science (syllabus 9618). Structured question, 6 marks.
Source
A-Level Computer Science, Oct/Nov 2023 Paper 2 Variant 3, 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