Write a program to simulate lines in a grocery store we


Part 1:

Write a program to simulate lines in a grocery store. We want to determine what line configuration is best.

You should implement the following configurations:

1 Cashier and 1 line

Multiple Cashiers and Multiple Lines (where the people always choose the line with the fewest amount of people)

Multiple Cashiers with 1 line (Think Barnes and Noble) Ask if you don't know what I mean.

The expected service time is 1 minute per customer, once it is their turn at the cashier.

Between zero and two customers join the line every minute.

Your algorithm should keep track of:

the total number of customers served
the combined total wait time of all customers
the maximum length of time any of these customers spent waiting in line

At the end of your program, you should produce a chart with the following information:

Time, Total Number of Customers Served, Average Wait, Longest Wait for each of the following time intervals:
30 minutes
60 minutes
120 minutes
480 minutes

Run your simulations at least a 100 times and determine which method is best.

Part 2: Add an expansion to your program that determines the results if you randomly assign expected service times between 1 and 4 minutes (use whole minutes)

Part 3: Add an expansion to your program that determines the expected service time by the number of items that the person has in their cart. Randomly assign a number of items to their cart. Determine if it is better to get in a line that has the fewest number of people or one that has the fewest amount of items in everyone's carts.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program to simulate lines in a grocery store we
Reference No:- TGS01082522

Expected delivery within 24 Hours