Write a simulation program of the lines at a grocery store. The program will be similar to
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 multiple queues instead of one. You might use an array (or 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.
For additional work, expand the grocery line program to allow shoppers to:
• Avoid a line if all lines are a certain length
• Leave a line if they have waited beyond a certain time
• Check if another line is shorter at specified time intervals
• Switch lines if another line is shorter
Step by Step Answer:
Heres a simulation program in Python to simulate the lines at a grocery store import random import q...View the full answer
Students also viewed these Computer science questions
-
This project uses the Towers class from Chapter 3s Programming Project 12. For the project, write a recursive methodxtxhxat computes and prints a solution to the Towers of Hanoi game. The method...
-
In this project, you will design and implement a class called Towers, which is part of a program that lets a child play a game called Towers of Hanoi. The game consists of three pegs and a collection...
-
Write a simulation program to price a European call option, whose underlying stock price follows a geometric Brownian motion with volatility = 0.1. Other parameters are r = 0.05, q = 0, S = K = 10,...
-
1. Conduct a SWOT analysis for HHI's proposed electronic commerce Web site. You can use the information in the case narrative, your personal knowledge of the retail hardware industry, and information...
-
When data are summarized in a frequency table, the median can be found by first identifying the median class (the class that contains the median). We then assume that the scores in that class are...
-
Discuss the continuity of the function. f(x, y) = (sin(x - y) x - y 1, x = y x = y
-
Describe the wide variety of legal issues that occur in the emergency department setting.
-
From its first Red Lobster in 1968, Darden Restaurants has grown the chain to 690 locations, with over $2.6 billion in U.S sales annually. The casual dinning market may be crowded, with competitors...
-
How do you determine an employee's emotional stability to things like stress in the workplace? Is this ability learned by you do you think it is something you were born with?
-
Dr. Zhivgo Diagnostics Corp. income statements for 20X1 are as follows: Sales $2,790,000 Cost of goods sold 1,790,000 Gross profit 1,000,000 Selling and administrative expense 302,000 Operating...
-
Do an airplane simulation that is more complex than the previous project. In this version, planes arrive for landing with a random amount of fuel, which determines how long they can remain in the...
-
Write a program that uses a priority queue to store a list of prioritized chores.
-
Find the derivative of each function defined as follows. g(t) = 37t 3 1
-
Perform the multiplication shown below. 2.69 6y 3
-
Wiseman Inc. Manufacturing produces Health Drinks in a Manufacturing facility. The products are: Health Shake Pre - Work out Post - Work out Wiseman introduced a 4 th Product: Health bar, made from 3...
-
How much will Kojo Mensah Enterprise be credited by Ghana Revenue Authority in the month of July 2 0 1 7 The following transaction occurred during the year 2 0 1 7 in the operations of Best - Buy...
-
A ticket is sold for a flat rate of $ 5 8 . 0 0 and the customer pays the $ 5 8 . 0 0 at the time of the sale. What will be the general journal entry for the company selling the ticket at a sales tax...
-
The purpose of this part is to provide you with a better understanding of the origins of the Codification. For this part, you should stay in the Codification, clicking on the tab Other Sources ( on...
-
What is a partner's capital account? Describe how a partner's ending capital account balance is determined.
-
Funds are separate fiscal and accounting entities, each with its own self-balancing set of accounts. The newly established Society for Ethical Teachings maintains two funds-a general fund for...
-
In a complete binary tree or a proper binary tree or a strictly binary tree if the number of internal nodes is N, then the number of leaves or exterior nodes, E are? A. E = 2*N -1 B. E = N + 1 C. E =...
-
Write a note on breadth frst traversal and depth frst traversal?
-
The number of edges or links from the root node to the deepest leaf is called _________ of the tree. A. Height B. Depth C. Length D. Width
-
A friend owes you $500 in 1 year from now, and then $1000 2 years from now. Both loans are at 5%. If you want to replace both of these loans with ONE PAYMENT NOW, how much would your friend give you ?
-
If the amount of retained earnings at the beginning of the year was $ 3 0 , 0 0 0 , and $ 1 2 , 0 0 0 in dividends is paid during the year, calculate net income for the year.
-
On January 2, 20Y4, Whitworth Company acquired 33% of the outstanding stock of Aloof Company for $330,000. For the year ended December 31, 20Y4, Aloof Company earned income of $86,000 and paid...
Study smarter with the SolutionInn App