Skip to main content
A-LevelComputer ScienceProgramming9618/32 · May/June 2025 · Q135 Marks

The pseudocode algorithm below uses random file access to copy 50 records from a live file CurrentResults.dat to a stored file StoredResults.dat one record at a time. It uses the user-defined type StudentResult. TYPE StudentResult DECLARE LastName : STRING DECLARE FirstName : STRING DECLARE ExamGrade : STRING ENDTYPE If any grades are missing in CurrentResults.dat, the text "Missing grade" is added to the ExamGrade field in StoredResults.dat Complete this file handling pseudocode algorithm. DECLARE Grade : StudentResult DECLARE Position : INTEGER OPENFILE "StoredResults.dat" FOR RANDOM SEEK "CurrentResults.dat", Position GETRECORD "CurrentResults.dat", Grade IF Grade.ExamGrade = "" THEN ENDIF NEXT Position CLOSEFILE "CurrentResults.dat" CLOSEFILE "StoredResults.dat"

  1. The pseudocode algorithm below uses random file access to copy 50 records from a live file CurrentResults.dat to a stored file StoredResults.dat one record at a time. It uses the user-defined type StudentResult. TYPE StudentResult DECLARE LastName : STRING DECLARE FirstName : STRING DECLARE ExamGrade : STRING ENDTYPE If any grades are missing in CurrentResults.dat, the text "Missing grade" is added to the ExamGrade field in StoredResults.dat Complete this file handling pseudocode algorithm. DECLARE Grade : StudentResult DECLARE Position : INTEGER OPENFILE "StoredResults.dat" FOR RANDOM SEEK "CurrentResults.dat", Position GETRECORD "CurrentResults.dat", Grade IF Grade.ExamGrade = "" THEN ENDIF NEXT Position CLOSEFILE "CurrentResults.dat" CLOSEFILE "StoredResults.dat"[5]

Mark scheme

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

  1. DECLARE Grade : StudentResult
  2. DECLARE Position : INTEGER
  3. OPENFILE "CurrentResults.dat" FOR RANDOM
  4. OPENFILE "StoredResults.dat" FOR RANDOM
  5. FOR Position ← 1 TO 50
  6. SEEK "CurrentResults.dat", Position
  7. GETRECORD "CurrentResults.dat", Grade
  8. IF Grade.ExamGrade = "" THEN
  9. Grade.ExamGrade ← "Missing grade"
  10. ENDIF
  11. SEEK "StoredResults.dat", Position
  12. PUTRECORD "StoredResults.dat", Grade
  13. NEXT Position
  14. CLOSEFILE "CurrentResults.dat"
  15. CLOSEFILE "StoredResults.dat"

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, 5 marks.
Source
A-Level Computer Science, May/June 2025 Paper 3 Variant 2, question 13.

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