Consider the following diagram representing seats in a movie theater where each seat is specified by a row number ranging from 1 to 7 (inclusive) and a column number ranging from 1 to 10 (inclusive). The theater's ticketing system has already allocated Andrew ("A"), Sally ("S") and Rufus ("R") seats for an upcoming screening.
Question Image
The ticketing system stores ticketing information in a collection called TICKETS. TICKETS is composed of nodes where values alternate between integers and strings - each integer has encoded seating information for the customer whose name is held as a string in the next node. The first two digits and the last two digits of each integer specify the row number and column number of a seat respectively. For example, Rufus has a ticket for the third seat across in the second row. TICKETS contains only those customers with a ticket and all ticket holders have exactly one allocated seat each.
Question Image
(a).
Write in pseudocode a procedure that outputs all ticket holder names held in TICKETS.
[3]
(b).
Identify one problem with storing ticketing information in this way and explain why a 2D array would be more appropriate.
[3]
(c).
Given a 12x10 2D array called TIX, write pseudocode to parse ticketing information from the collection TICKETS into TIX such that ticket holder names are copied to a TIX index representative of their seat location. For example, TIX[0][0], TIX[1][2], and TIX[6][9] should hold the names "Andrew", "Rufas" and "Sally" respectively. Unassigned seats should be indicated in TIX by the string "Empty".
[9]

Extended Response15 MarksPremium
40 Uses96 Views2 Likes
Login or Create an Account to view the mark scheme and add to a test