Question: Write a simulation program of the lines at a grocery store. The program will be similar to the car wash simulation, except that there are

Write a simulation program of the lines at a grocery store. The program will be similar to the car wash simulation, except that there are multiple queues instead of one. You might use a vector of queues to simulate the lines. Assume that there are five cashier lines at the grocery store. Customers enter randomly to check out, and then enter the shortest line. If the lines are equal, then the first available line is chosen. Each transaction takes a random amount of time to complete.

Use the car wash simulation in page 401-411 The program provides a simulation of the lines at a grocery store. The program is similar to the car wash simulation from the text but utilizes 5 queues instead of 1 to represent five cashiers with checkout lines. Customers enter the shortest line (queue) to check out. If the lines are of equal size then the customer enters the first line. Transaction times (ringing up customers) are random (within the range of 10 to 600 seconds). When the program is finished running it prints out the number of customers served and the average wait time in seconds. Input The probability (use percentage scale from 1 to 100 where 100 means 1 customer per second) that a new customer arrives during any given second (we assume that, at most, one customer arrives in a second) The total length of time to be simulated (in seconds) Output The number of customers serviced in the simulation The average time that a customer spent in line

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!