Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A small grocery store has one checkout. You have been asked to write a program to simulate the grocery store as it checks out customers.

A small grocery store has one checkout. You have been asked to write a program to simulate the grocery store as it checks out customers. YOU ARE REQURED TO USE A QUEUE TO SOLVE THE PROBLEM. The queue program is

class Queue: def __init__(self): self.items = []

def isEmpty(self): return self.items == []

def enqueue(self, item): self.items.insert(0, item)

def dequeue(self): return self.items.pop()

def size(self): return len(self.items)

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) 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

Note: Please use python language and class method

(use Python languge please ) IDLE (python 3.5)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions