Skip to main content
O-LevelComputer ScienceProgramming2210/22 · May/June 2024 · Q410 Marks

A program needs to make sure the characters input for a product code meet these rules: • The product code is six characters in length. • The first two characters must be "PD". • The last four characters must be a number in the range 1000 to 9999 inclusive.

  1. (a)Identify three validation checks and state how each check would make sure the product code met one of these rules.[6]
  2. (b)(i)Write the pseudocode to make sure that the product code is six characters in length.[2]
  3. (b)(ii)Write the pseudocode to make sure that the first two characters of the product code are "PD".[2]

Mark scheme

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

  1. One mark per mark point
  2. MP1 length check ...
  3. MP2 ... to ensure the product code entered is 6 characters in length
  4. MP3 format check ...
  5. MP4 ... to ensure the first two characters of the product code entered are "PD"
  6. MP5 range check ...
  7. MP6 ... to ensure that the value of the last four figures of the product code entered is between 1000 and 9999
  8. One mark for correct use of LENGTH operation, one mark for appropriate test
  9. Example:
  10. REPEAT
  11. INPUT Product
  12. UNTIL LENGTH(Product) = 6
  13. One mark for correct use of SUBSTRING operation, one mark for appropriate test
  14. Example:
  15. REPEAT
  16. INPUT Product
  17. UNTIL SUBSTRING(Product, 1, 2) = "PD"

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, O-Level Computer Science (syllabus 2210). Structured question, 10 marks.
Source
O-Level Computer Science, May/June 2024 Paper 2 Variant 2, question 4.

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