Answered You can hire a professional tutor to get the answer.

QUESTION

Question:6) A small grocery store has one checkout. You have been asked to come up with a program to simulate the grocery store as it checks out...

Question:please to use Python language ( idle 3.6)

A small grocery store has one checkout. You have been asked to come up with a program to simulate the

grocery store as it checks out customers. YOU MUST USE A QUEUE TO SOLVE THE PROBLEM.

The queue program (qu.py). Here are some guidelines:

1. A customer gets to the checkout every 1 - 5 minutes

2. The checker can process one customer every 5 - 15 minutes (depends on how many groceries

customer has - 10 items or less will take 5 minutes, 11 - 20 items will take 6 - 10 minutes, more

than 20 items will take 11 - 15 minutes - you will need two random numbers)

3. The program should find the average wait time for customers and the number of customers left

in the queue

4. Use the random number generator to get values for when customers get to the checkout and

how long the checker will take.

5. You are not required to use classes, but it might make things easier

Extra :

Add another checkout. This one should be an express lane in which customers with 10 or less items can

use it. Modify the original program so that it now has 2 queues, one for the regular checkout and one

for the express checkout. Express customers arrive at the checkout every 1-2 minutes. The express

checker can process a customer every 2-5 minutes.

You will need to figure out how to determine if the customer is express or not.

The program should print out the same as above plus average wait time for express customers and

number of express customers still in the queue.

:   ):    .items = []   ):     .items == []   , item):    .items.insert(, item)   ):     .items.pop()   ):     len(.items)
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question