May/June 2026 Paper 23

2026 · 8 questions · 27 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong27Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
5(a)String HandlingMedium4 marks
Data is stored about people who have attended a job interview. Each interview is held at one of three office locations. Each person's data is stored as a data packet made up of four data items: • The initial is a single character. • The shortened surname is the first five characters of the surname. You can assume all surnames are at least five characters. • The office code is a single character 'A', 'B' or 'C'. • The interview summary text is of variable length. Example: Peter Watkins was interviewed at office 'B'. After the interview it was decided to invite him for a second interview. His data packet is stored by variable Applicant:
pseudocode
Applicant ← "PWatkiBSecond interview"
A pseudocode function InterviewSummary() will: • take the data packet as a single parameter • return the interview summary text. Write the pseudocode for the function InterviewSummary()

Answer

0 words
5(b)File Handling ExceptionsHard7 marks
The data for all interviews is saved in this format in a text file JobApps.txt. Each line of the file stores one data packet. A procedure Search() is written to search for a particular applicant. If the applicant is found, the program will output 'Name found', otherwise it will output 'Name not found'. Complete the pseudocode for procedure Search(), by placing the correct pseudocode into each of the seven gaps ①–⑦.
pseudocode
PROCEDURE Search(Initial : CHAR, ShortSurname : STRING)   DECLARE ThisApplicant, ThisSurname : STRING   DECLARE ThisInitial : CHAR   DECLARE Found : BOOLEAN   OPENFILE "JobApps.txt" ①   Found ← FALSE   REPEAT      ② "JobApps.txt", ThisApplicant      ThisInitial ← LEFT(ThisApplicant, 1)      ThisSurname ← ③      IF ThisSurname = ShortSurname ④ THEN         ⑤         OUTPUT "Name found"      ENDIF   UNTIL Found = TRUE ⑥   IF Found = FALSE THEN      OUTPUT "Name not found"   ENDIF   ⑦ENDPROCEDURE
① after OPENFILE "JobApps.txt"
② before "JobApps.txt", ThisApplicant
③ ThisSurname ←
④ after ShortSurname, before THEN
⑤ before OUTPUT "Name found"
⑥ after UNTIL
⑦ before ENDPROCEDURE