Skip to main content
A-LevelComputer ScienceData types and structures9618/32 · May/June 2023 · Q69 Marks

Write pseudocode statements to declare the composite data type, TAppointments, to hold data about patients for a dental clinic. It will include for each patient: • name (first name and last name) • date of birth • telephone number • date of last appointment • date of next appointment • all treatments are complete (yes or no).

  1. (a)Write pseudocode statements to declare the composite data type, TAppointments, to hold data about patients for a dental clinic. It will include for each patient: • name (first name and last name) • date of birth • telephone number • date of last appointment • date of next appointment • all treatments are complete (yes or no).[4]
  2. (b)This pseudocode algorithm reads dental records stored in a random file using the user-defined data type TAppointments and prints the contents of the file, one record at a time. Complete this file handling pseudocode: DECLARE DentalRecord : ARRAY[1:250] OF TAppointments DECLARE DentalFile : STRING DECLARE Count : INTEGER DentalFile ← "DentalFile.dat" OUTPUT "The file ", DentalFile, " contains these records:" OPENFILE REPEAT SEEK DentalFile, Count OUTPUT DentalRecord [Count] Count← Count + 1 (DentalFile)[5]

Mark scheme

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

  1. [4] One mark for TYPE TAppointments and ENDTYPE correct One mark for every two correct declarations (Max 3) Example answer TYPE TAppointments DECLARE Name : STRING DECLARE DateOfBirth : DATE DECLARE Telephone : STRING DECLARE LastAppointment : DATE DECLARE NextAppointment : DATE DECLARE TreatmentsComplete : BOOLEAN ENDTYPE
  2. [5] One mark for each correctly completed line (Max 5) DECLARE DentalRecord : ARRAY[1:250] OF TAppointments DECLARE DentalFile : STRING DECLARE Count : INTEGER DentalFile ← "DentalFile.dat" OUTPUT "The file ", DentalFile, " contains these records:" OPENFILE DentalFile FOR RANDOM Count ← 1 REPEAT SEEK DentalFile, Count GETRECORD DentalFile, DentalRecord [Count] OUTPUT DentalRecord [Count] Count ← Count + 1 UNTIL EOF(DentalFile) CLOSEFILE DentalFile

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
Data types and structures, A-Level Computer Science (syllabus 9618). Structured question, 9 marks.
Source
A-Level Computer Science, May/June 2023 Paper 3 Variant 2, 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