Use a queue to simulate the flow of bus transportation system. The passenger may be wait...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 Longest Wait and which passenger Time Total Number of in minutes Passengers Served Average Wait 30 82 200 610 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 Longest Wait and which passenger Time Total Number of in minutes Passengers Served Average Wait 30 82 200 610
Expert Answer:
Answer rating: 100% (QA)
include include include using namespace std class to represent t... View the full answer
Related Book For
Posted Date:
Students also viewed these computer engineering questions
-
Write and test a program to simulate the flow diagram of CSMA/CD in Figure 12.13. Figure 12.13 Flow diagram for the CSMA/CD Station has a frame to send K= 0 Legend T Frame average transmission time...
-
Write and test a program to simulate the flow diagram of CSMA/CA in Figure 12.15. Figure 12.15 Flow diagram of CSMA/CA Station has a frame to send K = 0 Legend K: Number of attempts T: Backoff time...
-
You have the following details about the First Banc Corp. bond: Maturity = 9 years, Coupon rate (annual) = 5.25%, Yield to maturity = 4.2%, Par value = $1,000. Calculate the value of the bond, its...
-
Consider three (ideally other) countries for which evidence features here. What are the key influences on cross-national comparative variation in the place and role of the HRM function?
-
Discuss the potential conflict among the various promotion managers. How could this be reduced?
-
Approximate f(x) to four decimal places. f(x) = (0 - e-), 2 x = -0.7
-
On January 1, 2020, the following debt was authorized and issued by Anderson Company. 1. \(\$ 50,000,5\)-year, \(9 \%\) convertible bonds payable, cash interest payable semiannually to yield \(10...
-
Appliance Center sells a variety of electronic equipment and home appliances. For the last 4 years, 2010 through 2013, the following quarterly sales (in $ millions) were reported. Determine a typical...
-
. QUESTION 41 Casper Landsten is a foreign exchange trader for a bank in New York. He has $1 million (or its Swiss franc equivalent) for a short term money market investment and wonders if he...
-
2. EMORY ALUMINUM The Emory Aluminum company rolls and sells aluminum foil in several widths. (Length is the same for all orders). Customers can order rolls of foil 24 inches, 20 inches, 12 inches,...
-
This Is Urgent I need the solution of it please
-
It is very easy to apply the audit risk model. All you have to do is to multiply figures together to determine the amount of testing you have to do. Discuss this statement.
-
It seems simple to prescribe a structural approach to organisational activities. It has been fashionable, for instance, to say that mechanistic structures with hierarchies built in are out of date...
-
Care has to be taken in applying the principle of prudence. Discuss.
-
The audit firm consists of a collection of individuals with varying degrees of experience and expertise. Briefly describe the role that individual staff members play in achieving audit objectives.
-
Review the methods used in the supplements, and then find a disruption or disaster situation that used one of these methods to model, understand, and evaluate alternative mitigation actions.
-
0 Skipped 2 Required CHOOSE THE BEST ANSWER 2. If you broke a vase while providing care in a client's home, you would: a) Ask the client how much it costs and give them cash or a cheque on your...
-
Give the products of the following reaction, where T is tritium: dioldehydrase Ad- CH CH3C-COH CoIII) coenzyme B12
-
In TCP, assume a client has 100 bytes to send. The client creates 10 bytes at a time in each 10 ms and delivers them to the transport layer. The server acknowledges each segment immediately or if a...
-
Assume the propagation delay in a broadcast network is 3 s and the frame transmission time is 5 s. Can the collision be detected no matter where it occurs?
-
Do some research and find out if SIP can provide the following services provided by modern telephone sets. a. Caller-ID b. Call-waiting c. Multiparty calling
-
Using the information from Exercise 17-74, complete the following requirements from the lessor's perspective. Assume that lessor classifies the equipment as inventory prior to the lease arrangement....
-
On January 1, 2020, Frozen Yogart Inc. signed a 10 -year lease for its retail outlet. The lease payments, paid semiannually, are based upon semiannual sales and will equal \(5 \%\) of sales with a...
-
On January 1, 2020, Lessee Inc. leased equipment at an annual payment of \(\$ 85,099\) payable at the beginning of each year for 4 years. The equipment had a fair value of \(\$ 400,000\), a book...
Study smarter with the SolutionInn App