Data Structures - Airport exercise Solution
- AceTutor
- Rating : 33
- Grade : A+
- Questions : 0
- Solutions : 823
- Blog : 1
- Earned : $26606.70
Write a program that simulates the operation of a busy airport that has only 2 runways to handle all takeoffs and landings. You may assume that each takeoff or landing takes 15 minutes to complete. One runway request is made during each five-minute interval, and the likelihood of a landing request is the same as for a takeoff request. Priority is given to planes requesting a landing. If a request cannot be honored, it is added to a takeoff or a landing queue.
Your program should simulate 120 minutes of activity at the airport. Each request for runway clearance should be time-stamped and added to the appropriate queue. The outputs of your program should include the final queue contents, the number of landings and takeoffs completed, and the average number of minutes spent in each queue.
Use a uniform random number generator to determine if a request is a landing request or a take-off request. Seehttp://www.cplusplus.com/reference/clibrary/cstdlib/rand/ for information on the basic C++ random number generator function rand. You MAY use STL data structures in the work.
Extra credit ( 20 points )
Instead of scheduling requests at a fixed five-minute interval, use a random number to determine the interval between takeoff or landing requests. Use an exponential random number for the interval. Show how the performance between this model and the base model differ.
[Solved] Data Structures - Airport exercise Solution
- This Solution has been Purchased 4 time
- Submitted On 21 Dec, 2014 09:01:12
- AceTutor
- Rating : 33
- Grade : A+
- Questions : 0
- Solutions : 823
- Blog : 1
- Earned : $26606.70
This Tutorial is rated A+ p...