Photo AI

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 icon

Question 3

The-new-airline-company,-Soaring-Eagles,-wants-to-optimise-the-check-in-process-of-their-passengers-NSC Information Technology-Question 3-2017-Paper 1.png

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

Answer

To display the queues of passengers according to the number of passengers in the arrPassengers array, follow these steps:

  1. Determine Number of Counters: Based on the size of the arrPassengers array, categorize the number of counters:

    • If there are 1 to 9 passengers: use 1 counter.
    • If there are 10 to 16 passengers: use 2 counters.
    • If there are 17 to 24 passengers: use 3 counters.
    • If there are more than 24 passengers: use 4 counters.
  2. Determine Number of Rows: Calculate the number of rows needed. This is done by dividing the total number of passengers by the number of counters, rounding up if necessary.

    Number of Rows=Number of PassengersNumber of Counters\text{Number of Rows} = \lceil \frac{\text{Number of Passengers}}{\text{Number of Counters}} \rceil

  3. Sort Passengers: Implement a sorting algorithm to arrange passengers in the queue. Use a nested loop structure to sort based on defined criteria and ensure elements are swapped correctly.

  4. Copy Passengers’ Information to 2D Grid: Initialize an array/grid structure to receive passenger data. Use nested loops to copy each passenger from the original array to the 2D grid using appropriate indices.

  5. Display Passengers in Queues: Create headings for the display tables. Loop through the rows and columns to print passenger classes and their respective numbers. Ensure that the correct number of headings and rows is displayed.

Step 2

Button – [3.2 - Create new list]

99%

104 rated

Answer

To create a new list of passengers based on delayed flights, follow these steps:

  1. Read Flight Number: Capture the flight number selected for delay from a combo box and display the corresponding flight number.

  2. Loop Through Array: Iterate through the arrPassengers array to check each passenger's flight number against the delayed flight number. For each match, track the number of passengers on that delayed flight.

  3. Remove Passengers from Rows: Using the initial passenger count, decrement the number of passengers corresponding to the delayed flight. Create a temporary array to hold the details of remaining passengers.

  4. Update Queue and Display: Loop through the updated passenger list array, ensuring not to include those on the delayed flight. Modify the original passenger array and update any counters. Finally, display the revised output clearly to show passengers who are not delayed.

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;