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...
-
Calculate the sales curve percent by month for one swimsuit style using the following unit sales data: February 100, March 115, April 120, May 120, June 115, July 110.
-
Create a frequency distribution and graph for the ANES variable regarding removing a member of the Supreme Court. How could you use these results to argue that Americans are in favor of removing a...
-
On July 1, 2014, Agincourt Inc. made two sales: 1. It sold excess land in exchange for a four-year, non-interest-bearing promissory note in the face amount of $1,101,460. The land's carrying value is...
-
Graham's Steel Parts produces parts for the automobile industry. The company has monthly fixed expenses of $ 6 4 0 , 0 0 0 and a contribution margin of 9 5 % of revenues. Graham feels like he's in a...
-
Design a Customer class to handle a customer loyalty marketing campaign. After accumulating $100 in purchases, the customer receives a $10 discount on the next purchase. Provide methods void...
-
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.
-
Do you think social loafing is always shirking (failing to live up to your responsibilities)? Are there times when shirking is ethical or even justified?
-
From a square whose side has length \(x\), measured in inches, create a new square whose side is 5 in. longer. Find an expression for the difference between the areas of the two squares as a function...
-
Sketch the requested conic sections in Problems 14-23 using the definition. A circle with radius 5
-
Find the present value of the ordinary annuities in Problems 21-32. Amount of Deposit m 23. $250 Frequency n semiannually Rate r 8% Time t 30 yr
-
Characterize the types of investments that are most vulnerable to political risk. Characterize those that are least vulnerable. What factors influence an investments vulnerability? On a scale of 1 to...
-
Refer to the following tree diagram for a two-stage experiment. Find the probabilities in Problems 1-6. \(P(B) \) E E A B C A B C
-
Multiplication and division. Simplify. 30xy (-6x)
-
Rosalie owns 50% of the outstanding stock of Salmon Corporation. In a qualifying stock redemption, Salmon distributes $80,000 to Rosalie in exchange for one-half of her shares, which have a basis of...
-
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
-
You buy a stock for $35 per share. One year later you receive a dividend of $3.50 per share and sell the stock for $30 per share. What is your total rate of return on this investment? What is your...
-
Filippucci Company used a budgeted indirect-cost rate for its manufacturing operations, the amount allocated ($200,000) is different from the actual amount incurred ($225,000). Ending balances in the...
-
Yard Professionals Incorporated experienced the following events in Year 1, its first year of operation: Performed services for $31,000 cash. Purchased $7,800 of supplies on account. A physical count...
Study smarter with the SolutionInn App