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
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 (columns) required based on the number of passengers in the arrPassengers array, follow these steps:
Determine Number of Counters: Using conditional statements, check the number of elements in the arrPassengers array:
If there are 1 to 9 passengers, set counters to 1.
If there are 10 to 16 passengers, set counters to 2.
If there are 17 to 24 passengers, set counters to 3.
For more than 24 passengers, set counters to 4.
Determine Number of Rows: Calculate the number of rows needed, which is determined by dividing the number of passengers by the number of counters. Round up if necessary.
Sort Passengers: Implement a sorting algorithm to arrange passengers in the array according to their flight information. This would involve:
Using an outer loop to iterate through each passenger.
Applying an inner loop to compare and swap elements to achieve the correct order.
Copy Passengers' Information to 2D Array/Grid: Create a 2D array to represent the queues. Use nested loops to populate it:
First loop through rows to determine the passenger's queue.
Use a counter to manage the number of passengers assigned to each queue based on their arrival order.
Ensure the correct indexing to copy data from the 1D passenger array to the 2D queue representation.
Display Passengers in Queues: Implement a display function that prints out the headings and passenger details:
Loop through each row and column of the 2D array to present each passenger’s information clearly.
Ensure to include the total counts of passengers in each queue.
Step 2
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 manage passengers from a delayed flight:
Read Flight Number: Capture the delayed flight number using a combo box and display it.
Loop Through Array: Iterate through the arrPassengers array:
Check if the flightNumber matches the delayed flight number.
If it matches, increment a counter (newPassengers) to keep track of all passengers from the delayed flight.
Remove Passengers from Rows: Adjust the original passenger list:
Subtract the newPassengers from the total number of passengers.
Create a temporary array to store remaining passengers post-removal.
Loop through the original arrPassengers array to populate this new array, excluding passengers from the delayed flight.
Update Counts and Display Output: Update necessary counters and display the new list of passengers effectively, ensuring clarity in how many total passengers are now assigned separate counters.