Skip to main content
O-LevelComputer ScienceProgramming2210/22 · Oct/Nov 2025 · Q47 Marks

A length check is a type of validation check. State the purpose of a length check.

  1. (a)A length check is a type of validation check. State the purpose of a length check.[1]
  2. (b)An email address can be validated by checking that it contains an @ symbol. Write the pseudocode for an algorithm that will allow an email address to be input and check whether or not it contains an @ symbol. Output a suitable message with the result. Use the string function SUBSTRING(EmailAddress, Start, 1) in your solution to return a string of length 1 character, starting at position Start, where EmailAddress is the identifier representing your input. You do not need to declare any variables for this algorithm, but variables must be initialised as necessary. Assume there will not be more than one @ symbol in the email address input.[6]

Mark scheme

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

  1. [1] To check that the data entered has the required number of characters.
  2. [1] MP1 Initialisation of variables – start location for checking and flag, if used
  3. [1] MP2 Input of email address into appropriate variable
  4. [1] MP3 Working condition-controlled loop present
  5. [1] MP4 Correct use of SUBSTRING
  6. [1] MP5 Use of condition for checking value extracted from SUBSTRING / '@'
  7. [1] MP6 Appropriate action if '@' found – loop termination
  8. [1] MP7 Appropriate action if ' @ ' NOT found – check the next character and loop termination if no more characters
  9. [1] MP8 Output that only shows when the email address is valid or invalid. Both cases required.
  10. [6] Example: // Variable declarations are not required INPUT EmailAddress Start ← 1 Valid ← FALSE REPEAT IF SUBSTRING(EmailAddress, Start, 1) = '@' THEN Valid ← TRUE ELSE Start ← Start + 1 ENDIF UNTIL Start > LENGTH(EmailAddress) OR Valid IF Valid THEN OUTPUT EmailAddress, " is valid" ELSE OUTPUT EmailAddress, " is NOT valid" ENDIF

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, 7 marks.
Source
O-Level Computer Science, Oct/Nov 2025 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