Airplane Gate Scheduler Your task is to develop a tool that

Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each Operations Manager should input how many gates they have to schedule (Expect 2 to 5 gates). The operations manager will have an arbitrarily long list of flights in a text file with the following format:

Airline Code (2 char code, such as AS, AA, DL, etc.)

Flight Number: (String – 4 chars)

Arrival Time: (hhmm 24 hour clock)

Example: AA 241 1420

                   AS   31    1142

Additional Constraints:

The airport is only open from 0600 to 2300 (6 AM – 11 PM). Planes cannot depart or arrive when the airport is closed.

Each plane will only be on the ground for 1 hour. After that, the gate is free.

The flights file may not be in order of arrivals.

Do not assume that you can schedule all the flights on the list. Notify the Operations Manager when you cannot schedule a flight, and the reason, i.e. gates full at that arrival time.

Assume that there will be more flights than you have gate time, so you will need to use all the gates.

You only need to schedule the flights on a single operational day, all flights are for same day.

The only optimization needed is to schedule the next flight as close a departing flight as possible, therefore, minimizing gaps where a gate isn’t being used. Once you schedule a flight, don’t move it around to make space for other flights

The implementation must use linked lists (SLL, DLL CLL, etc).

Output –

i.Output 1: of the program should be a listing by Gate of each flight in order of time, starting with the earliest flight of the day and ending with the latest flight of the day.

ii.Output 2: A list of unscheduled flights

iii.Output 3: A listing, by gate of the remaining available valid slots for Airplanes (should one happen to arrive unexpectedly, the Operations Manager would like to know which gate would be available.)

The text file:

YP 3102 1709
MZ 1350 1820
GC 2079 0830
SX 2079 1720
VV 9644 2319
AJ 7406 1147
RS 2750 1415
DO 2566 1359
KE 4995 2110
UY 2039 1646
AH 4167 0542
GB 5584 0245
DZ 9970 0442
NQ 7644 1053
TY 9789 2007
LZ 5296 2326
VM 6606 0351
VC 7148 0622
GZ 8491 0444
PM 9257 1515

Solution

#include <iostream>

#include <iomanip>

#include <string>

#include \"flyaway.h\"

#include \"schedule.h\"

#include \"items.h\"

#include \"map.h\"

#include \"location.h\"

#include \"clock.h\"

extern location rest_room;

extern location waiting_area;

extern location gate1;

extern location gate2;

extern location gate3;

extern location gate4;

extern location plane1;

extern location plane2;

extern location plane3;

extern location plane4;

extern items personal_items;

extern clock time_of_day;

extern words input_words;

extern map airport;

int visited_rest_room = FALSE;   // TRUE if the rest room was visited

// as checked in shuffle_gates

schedule::schedule(void)

{

    flight_number[0] = 222;

    flight_number[1] = 17;

    flight_number[2] = 141;

    flight_number[3] = 79;

    destination[0] = new char[7];

     strcpy(destination[0], \"HAWAII\");

    destination[1] = new char[7];

       strcpy(destination[1], \"PARIS \");

    destination[2] = new char[7];

       strcpy(destination[2], \"ROME \");

    destination[3] = new char[7];

     strcpy(destination[3], \"TAHITI\");

    depart_hour[0] = 9;

   depart_hour[1] = 9;

    depart_hour[2] = 9;

    depart_hour[3] = 9;

    depart_minute[0] = 19;

    depart_minute[1] = 17;

    depart_minute[2] = 16;

    depart_minute[3] = 18;

    gate[0] = &gate1;

    gate[1] = &gate2;

    gate[2] = &gate3;

    gate[3] = &gate4;

    flights_frozen = FALSE;

    gates_frozen = FALSE;

    my_gate = 0;

}

void schedule::shuffle_flights(void)

{

    if (!flights_frozen)    // Until flights are frozen,

       my_gate = (my_gate + 1) % 4; // select the next flight    // at the next gate.

}

void schedule::shuffle_gates(void)

{

int temp;

char *temp_point;

    if (airport.get_current_location() == &rest_room)

       visited_rest_room = TRUE;

    if ((airport.get_current_location() == gate[my_gate]) && (!gates_frozen)) {

       temp = flight_number[0];

       flight_number[0] = flight_number[1];

       flight_number[1] = flight_number[2];

       flight_number[2] = flight_number[3];

       flight_number[3] = temp;

      temp_point = destination[0];

       destination[0] = destination[1];

       destination[1] = destination[2];

       destination[2] = destination[3];

       destination[3] = temp_point;

        temp = depart_hour[0];

       depart_hour[0] = depart_hour[1];

       depart_hour[1] = depart_hour[2];

       depart_hour[2] = depart_hour[3];

       depart_hour[3] = temp;

   temp = depart_minute[0];

       depart_minute[0] = depart_minute[1];

       depart_minute[1] = depart_minute[2];

       depart_minute[2] = depart_minute[3];

       depart_minute[3] = temp;

       my_gate = (my_gate + 3) % 4;// Subtract one from my_gate

       cout <<

          \"A message is heard on the airport paging system, \\\"All\"

          \" gates\ have been rescheduled due to bad weather. No \"

          \"flights have\ been cancelled at this time.\\\"\ \";

    }

}// This freezes the gate assignments

void schedule::list_flights(location *current_location)

{

    if (current_location == &waiting_area)

       gates_frozen = TRUE;

    for (int index = 0 ; index < 4 ; index++) {

       printf(\"Gate %d - Flight %3d - %s - \",(index + 1), flight_number[index],destination[index]);

      list_time(index);

    }

}

void schedule::gate_message(location *current_location)

{

int index; // Find gate we are at and print message

    for (index = 0;index < 4;index++)

       if (current_location == gate[index]) goto gate_is_found;

     return;    // If not a gate

     gate_is_found:

    printf(\"Flight %3d - %s - \",     // If a gate is found

            flight_number[index],

            destination[index]);

    list_time(index);

}

          // This freezes the players flight

void schedule::list_actual_destination(void)

{

       flights_frozen = TRUE;

       printf(\"Flight %3d - %s - \", flight_number[my_gate],destination[my_gate]);

       list_time(my_gate);

}

void schedule::list_time(int index)

{

    if (depart_minute[index] < 10)

       printf(\"%d:0%d\ \",depart_hour[index], depart_minute[index]);

    else

       printf(\"%d:%d\ \",depart_hour[index], depart_minute[index]);

}

void schedule::check_flight(void)

{

    if ((airport.get_current_location() == &plane1) ||(airport.get_current_location() == &plane2) || (airport.get_current_location() == &plane3) |(airport.get_current_location() == &plane4))

{

// You must have a ticket

       if (!personal_items.item_here(ticket))

          cout <<

          \"Unfortunately, you don\'t have a ticket, you are arrested\ \"

          \"as a stowaway and drug off the plane screaming. \"\ No vacation for you.\ \";

      // On plane 1 from gate 1

       else if ((airport.get_current_location() == &plane1) &&(my_gate != 0))

          cout <<

          \"Unfortunately, you are at gate 1 and this flight is going\ \"

          \" to \" << destination[0] << \". Better luck next time.\ \";

                                  // On plane 2 from gate 2

       else if ((airport.get_current_location() == &plane2) && (my_gate != 1))

          cout <<

          \"Unfortunately, you are at gate 2 and this flight is going\ \"\" to \" << destination[1] << \". Better luck next time.\ \";

        // On plane 3 from gate 3

       else if ((airport.get_current_location() == &plane3) &&(my_gate != 2))

          cout <<

          \"Unfortunately, you are at gate 3 and this flight is going\ \"

          \" to \" << destination[2] << \". Better luck next time.\ \";

          // On plane 4 from gate 4

       else if ((airport.get_current_location() == &plane4) &&(my_gate != 3))

          cout <<

          \"Unfortunately, you are at gate 4 and this flight is going\ \"

          \" to \" << destination[3] << \". Better luck next time.\ \";

                                                // You must be on time

       else if ((time_of_day.present_hour() > depart_hour[my_gate]) ||

                (time_of_day.present_minute() > depart_minute[my_gate]))

          cout <<

          \"Unfortunately, you are too late for your flight and are\ \"

          \"aboard a cargo plane to Greasy Creek, Missouri. Better\ \"

          \"luck next time.\ \";

           // You must have candy

       else if (!personal_items.item_here(candy))

          cout <<

          \"Unfortunately, you failed to bring any food along and you\ \"

          \"died of malnutrition half way to your destination.\ \";

              // You must visit the rest room

       else if (!visited_rest_room)

          cout <<

          \"Unfortunately, you forgot to take care of your bladder\ \"

          \"problem back at the airport.The restrooms on this plane\ \"

          \"are out-of-order. You suffer a ruptured bladder and die\ \"

          \"enroute to your destination.\ \";

                             // A successful trip through the airport

       else

          cout <<

          \"Congratulations, you are comfortably enroute to your well\ \"

          \"deserved vacation. You can study the source code to this\ \"

          \"program on the plane. If you do not have the source code,\ \"

          \"you can read the paper in the lobby for the address where\ \"

          \"you can write for more information.\ \";

       cout << \"\ Hit any key to end the game.\ \";

       getch();                  // Wait for keyhit

    }

}

Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each
Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each
Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each
Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each
Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each
Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each
Airplane Gate Scheduler: Your task is to develop a tool that assists Airport Operations managers in allocating Boarding gates to scheduled airline flights. Each

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site