Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

Does it avoid using personal pronouns (such as I and me)?

Answered: 1 week ago

Question

Does it clearly identify what you have done and accomplished?

Answered: 1 week ago