Note:use c++ data structure queue if you take solve from another person on chegg i will make report on you Use a queue to simulate
Note:use c++ data structure queue
if you take solve from another person on chegg i will make report on you
Use a queue to simulate the flow of bus transportation system. The passenger may be wait in the bus-station in a queue. In this simulation you have the following details:
- one waiting queue
- Every one minute one passenger should take his ticket and served. (Note that the passenger may have to wait in the line before being served)
- Every minute many passengers (between 0 and 2) may be added to the queue.
You can simulate the flow of passengers through the queue during a time of period N minutes long
Your simulation system will keep track of the following:
- The total number of passengers served
- The total wait time of all passengers
- The passenger that waits the maximum period of time in the queue.
Test your simulation code according to the following table
Time In minutes | Total Number of Passengers Served | Average Wait | Longest Wait and which passenger |
30 |
|
|
|
82 |
|
|
|
200 |
|
|
|
510 |
|
|
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started