May/June 2026 Paper 21

2026 · 9 questions · 28 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong28Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
6(a)String HandlingMedium2 marks
Fence parts are manufactured by a number of similar machines. The length of the part must fall within a certain range. Parts not within the length range are rejected. The data for each rejected part forms a data packet made up of three data items, each separated by the '/' character delimiter. The format of a data packet is:
text
<length>/<machine ID>/<description of the fault>
  • The length is 3 digits (in millimetres).
  • The machine ID is a single character ('A', 'B', or 'C').
  • The description of the fault is a variable length string.
A pseudocode program will process the data for several data packets. The program contains the statement:
pseudocode
DataPacket ← "563/B/the fence length is too long"
Complete the two pseudocode expressions which extract the appropriate data item.
6(b)String HandlingMedium4 marks
The program will create a module RejectDescription() to return the fault description. Write the pseudocode for the module RejectDescription()

Answer

0 words
6(c)File Handling ExceptionsHard6 marks
The data packets for all rejected parts are saved in this format in a text file Rejects.txt. The file stores one data packet per line. Write pseudocode to:
  • find all the rejected parts with a length greater than 560 millimetres and that were produced on machine 'B' or machine 'C'
  • output the description for each matching rejected part.
Your pseudocode will include a module call to RejectDescription() and the answers given for 6(a).

Answer

0 words