Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!