Question: An airport has only one runway. When it is busy, planes wishing to take off or land have to wait. Implement a simulation, using two
An airport has only one runway. When it is busy, planes wishing to take off or land have to wait. Implement a simulation, using two queues, one each for the planes waiting to take off and land. Landing planes get priority. The user enters commands takeoff flightSymbol, land flightSymbol, next, and quit. The first two commands place the flight in the appropriate queue. The next command finishes the current takeoff or landing and enables the next one, printing the action (takeoff or land) and the flight symbol.
Step by Step Solution
3.33 Rating (162 Votes )
There are 3 Steps involved in it
ANSWER Create two queues let takeoffQueue let landQueue Function to add flights to t... View full answer
Get step-by-step solutions from verified subject matter experts
