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?
-
Do the same as in Problem 9 for an autonomous increase in investment of 200 in Nation 2. In Problem 9 Assuming that Nations 1 and 2 are both large, and starting from the equilibrium level of national...
-
Use either indirect proof or conditional proof to derive the conclusions of the following symbolized arguments.
-
If you are preparing a client for a deposition, what rules for responding to deposition questions should you review with the client?
-
The SEC Form 10-K of Google is reproduced online at www.wiley.com/college/pratt. REQUIRED: Review the Google 10K, and answer the following questions: a. What percentage of Googles total assets were...
-
(a) Give a list of the common applications of planetary gear trains. Describe the working of the dif- ferential mechanism of a motor car. (b) In the planetary gear train shown in Fig.15.37, gear 1...
-
A company's debt is given by a bond that will mature in two years. After two years the company will terminate all activity. The company unlevered equity value in two years can be $17 millions with a...
-
April 2017 May 2017 Revenues $12,600,000 $18,900,000 Variable costs: Beginning inventory $0 $1,575,000 Variable manufacturing costs 6,300,000 5,775,000 Cost of goods available for sale 6,300,000...
-
How reasonable is it for every country to follow policies aimed at increasing net exports?
-
Why do teenagers have the highest unemployment rate in the economy?
-
Does the following statement make sense? You made a real blunder. The $600 you paid for repairs is worth more than the car.
-
Consider a flat plate moving across the surface of water with a velocity of \(5 \mathrm{~m} / \mathrm{s}\). The dimensions of the plate are \(2 \mathrm{~m} \times 2 \mathrm{~m}\). a. Calculate the...
-
Does the GDP gap measure all of the costs of unemployment? Why or why not?
-
As we enter a post pandemic world, employers are facing major challenges to get their employees back to work. (i) Describe the challenges employers are experiencing. (ii) How should employers deal...
-
Draw and label the E and Z isomers for each of the following compounds: 1. CH3CH2CH==CHCH3 2. 3. 4. CH,CH2C CHCH2CH Cl CH3CH2CH2CH2 CH CH2CCCH2CI CHCH3 CH3 HOCH CH CCC CH O-CH C(CH
-
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
-
Prove that van der Waals constants \((a, b)\) can be expressed in terms of critical temperature and pressure as follows: a = 27 R 2 T 2 c 64 P c b = R T c 8 P c a = 27 R 2 T c 2 64 P c b = R T c 8 P c
-
Justify the following statement with illustration: 'Violation of Kelvin-Planck statement leads to the violation of Clausius statement'.
-
Show that where \[ \left(\frac{\partial U}{\partial V} ight)_{T}=\frac{T \beta}{\kappa}-P \] \(\beta=\) Coefficient of volume expansion \(\kappa=\) Isothermal compressibility.
Study smarter with the SolutionInn App