Skip to main content
A-LevelComputer ScienceProgrammingOct/Nov 2023Paper 2 Q818 Marks

A class of students are developing a program to send data between computers. Many computers are connected together to form a wired network. Serial ports are used to connect one computer to another. Each computer: • is assigned a unique three-digit ID • has three ports, each identified by an integer value • is connected to between one and three other computers. Data is sent as individual message strings. Each string contains the destination ID (the ID of the computer that is to receive the message) followed by the data: <DestinationID><Data> Messages may pass through several computers on the way to their destination. When a message arrives at a computer, that is not the destination, the program needs to forward it on to another computer using one of its serial ports. The port to use is obtained from information that is stored in an array RouteTable. RouteTable is a global 2D array of integers. It is declared in pseudocode as follows: DECLARE RouteTable : ARRAY[1:6,1:3] OF INTEGER The values in the first two columns of RouteTable define a range of ID values. Column 3 gives the corresponding port number to use when forwarding the message to a computer with an ID within this range. For example, the contents of RouteTable could be: Column 1 Column 2 Column 3 Row 1 100 199 1 Row 2 200 259 2 Row 3 -1 <undefined> <undefined> Row 4 260 399 2 Row 5 400 599 3 Row 6 600 999 1 In this example, a message that arrives with a DestinationID of "283" will be forwarded using port 2. Row 3 in the example shows an unused row. These may occur anywhere. Unused rows have the column 1 element set to -1. The value of unused elements in the other two columns is undefined. The programmer has defined the first program module as follows: Module Description GetPort() • takes a DestinationID as a parameter of type string • searches for the range corresponding to the DestinationID in the array • returns the port number, or returns -1 if no corresponding range is found

📋 Examiner Report & Trap Analysis

Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...

🎯 Mark Scheme Breakdown

Award 1 mark for identifying the correct principle. Award 1 mark for showing clear working. Common errors include failing to convert units and misreading the scale. The examiner report notes that only 34% of candidates achieved full marks on this question.

🔒

Unlock the Examiner's Analysis

Sign up for free to reveal the full examiner report, trap analysis, and mark scheme breakdown for this question.

Sign Up Free to Unlock →

Join thousands of Cambridge students already using Oracle Prep

About This A-Level Computer Science Question

Topic

This structured question tests Programming in A-Level Computer Science (syllabus code 9618). It is worth 18 marks.

Source

This question appeared in the Cambridge A-Level Computer Science Oct/Nov 2023 examination, Paper 2 Variant 2.

Practice on Oracle Prep

Oracle Prep provides AI-powered practice for all Cambridge O-Level and A-Level subjects. Our platform includes topic predictions with 87.7% accuracy, AI essay grading, and a comprehensive question bank spanning 25 years of past papers across 29 subjects.

Related Computer Science Questions

© 2026 Oracle Prep — The AI-Powered Cambridge Exam Engine