The new airline company, Soaring Eagles, wants to optimise the check-in process of their passengers - NSC Information Technology - Question 3 - 2017 - Paper 1
Question 3
The new airline company, Soaring Eagles, wants to optimise the check-in process of their passengers. The number of counters that will be opened and manned by their s... show full transcript
Worked Solution & Example Answer:The new airline company, Soaring Eagles, wants to optimise the check-in process of their passengers - NSC Information Technology - Question 3 - 2017 - Paper 1
Step 1
Button – [3.1 - Display queues]
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To determine the number of check-in counters based on the number of passengers in the arrPassengers array, follow these steps:
Determine Number of Counters:
For 1 to 9 passengers: counter 1
For 10 to 16 passengers: counter 2
For 17 to 24 passengers: counter 3
For More than 24 passengers: counter 4
Determine Number of Rows:
Calculate the number of rows as:
extNumberofRows=⌈Number of CountersNumber of Passengers⌉
Sort Passengers in Array:
Implement an outer loop to iterate through the array of passengers and an inner loop for sorting. Ensure to swap elements correctly.
Copy Passengers' Information to 2D/ Grid:
Initialize the counter to test the end of the array.
Use a loop through the rows (for) and columns (while), updating the grid with the correct indexes.
Display Passengers in Queues:
Loop through the headings and the data, ensuring that the correct number of rows and columns are displayed for each passenger's class and number.
Step 2
Button – [3.2 – Create new list]
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To handle the delayed flight:
Read Flight Number:
Read the number of the delayed flight from the combo box and display the corresponding flight number.
Loop Through Passenger Array:
Test if the flight number matches the delayed flight number.
Increment newPassengers on the delayed flight and display at the new counter.
Remove Passengers from Delay Flight:
Decrement the number of passengers based on the initial number of passengers in the delayed flight and create a temporary array for the remaining passengers.
Update Original Passenger Array:
Loop through the original passenger array and adjust passenger numbers as necessary. Display updated output.