Skip to main content
A-LevelComputer ScienceProgramming9618/32 · Oct/Nov 2023 · Q129 Marks

Describe, with an example, what is meant by an exception.

  1. (a)Describe, with an example, what is meant by an exception.[2]
  2. (b)A pseudocode algorithm searches for a customer record in a random file AccountRecord.dat.A user inputs the name of the customer. The records are stored using the user-defined data type TAccount. TYPE TAccount DECLARE AccountNumber : INTEGER DECLARE Name : STRING DECLARE Address : STRING DECLARE Telephone : STRING ENDTYPE If the record is found, it is output, otherwise an error message is displayed. Complete the file handling pseudocode. DECLARE Customer : TAccount DECLARE Location : INTEGER DECLARE MaxSize : INTEGER DECLARE FoundFlag : BOOLEAN DECLARE SearchCustomer : STRING MaxSize ← 1000 OPENFILE Location ← 1 OUTPUT "Enter the customer's name" FALSE AND Location <= MaxSize "AccountRecord.dat", GETRECORD "AccountRecord.dat", Customer IF SearchCustomer = Customer. Name THEN OUTPUT "Customer found: " OUTPUT Customer // output customer record FoundFlag ← TRUE ENDIF Location ← Location + 1 ENDWHILE IF NOT FoundFlag THEN OUTPUT " " ENDIF[7]

Mark scheme

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

  1. [1] An exception is an event that occurs during the execution of a program that disrupts the normal flow of instructions / causes the program to halt execution
  2. [1] Hardware failure // hard disk crash
  3. [1] Programming error // trying to access out-of-bounds array element // divide by zero error // runtime error
  4. [1] User error // typing incorrect filename / data type
  5. [1] OPENFILE "AccountRecord.dat" FOR RANDOM
  6. [1] FoundFlag ← FALSE
  7. [1] INPUT SearchCustomer
  8. [1] WHILE NOT FoundFlag AND Location <= MaxSize
  9. [1] SEEK "AccountRecord.dat", Location
  10. [1] GETRECORD "AccountRecord.dat", Customer
  11. [1] IF SearchCustomer = Customer. Name THEN
  12. [1] OUTPUT Customer
  13. [1] FoundFlag ← TRUE
  14. [1] OUTPUT "Customer does not exist."

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, 9 marks.
Source
A-Level Computer Science, Oct/Nov 2023 Paper 3 Variant 2, question 12.

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