Question: Write a simulation program to simulate lines at a grocery store for a typical day's business. You will assume there are three cashier lines at

 Write a simulation program to simulate lines at a grocery store
for a typical day's business. You will assume there are three cashier
lines at the grocery store. Customers will enter randomly to check out
(this is a time stamp in the input file) and will enter

Write a simulation program to simulate lines at a grocery store for a typical day's business. You will assume there are three cashier lines at the grocery store. Customers will enter randomly to check out (this is a time stamp in the input file) and will enter the shortest line. If the lines are equal, then the first line in the queue will be selected. Each transaction takes a random amount of time to complete (this also is a number from the input file). The grocery store operates on a ten hour business day and only 6 customers per queue will be able to wait for service at any time. If a customer arrives and there are 6 in all the queues, the customer will be turned away. To perform the simulation, a number, a time stamp, and a service time (randomly generated between 1 and 20 minutes) is given for each customer. This information will be in an input file. The first item in the input file will be the number of customers in the file. To keep the simulation simple, this time stamp will be a count of the number of minutes elapsed from the start of the business day. The time stamps will be in order in the file. So the time could be any values from 0 to 570 (no new business will be allowed 30 minutes before closing, so the waiting queue can be cleared out, hopefully, before the end of the business day.) There will be a time counter which will start at 0 when the simulation starts. No two customers can arrive at the same minute. Customers should be taken out of the queue when the cashier starts serving them. This simulation will inform the owner how many customers were serviced, how many were turned away, the average time any customer in the queue spent waiting, and the total time customers spent waiting. You will generate your own input file to test your program that will have a number a time stamp from 0 to 570 in order, and a service time. Those will be your customers. The grader will use a standard file to test all the projects To simulate the time, you will use a loop that increments the "timer" by 1 each time through the loop

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!