Question 13 2025 · May-June · Paper 32 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 13
Question 5
Show text version of question
Question 13
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"
,
,
Question 14
,
,
Question 15
Question 16
, ,
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
Why this question appears here
82% assigned-topic match · Data types and structures › Data types and records
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_s25_qp_32.pdf
