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...
-
Estimate the diameter to which the Sun would have to be expanded for its average density to be the critical density found in Problem 48. Data From Problem 48 Estimate the critical density of the...
-
Find the z-score that has 4.887% of the distributions area to its right. Find the indicated z-score.
-
Fernandez Corporation currently has 500,000 shares $1 par value common stock authorized with 200,000 shares outstanding. The board of directors declared a 2-for-1 split on May 15, 2010, when the...
-
NGA is listed on the Stock Exchange of a central European country. The company manufactures a wide range of pharmaceutical products including modern drugs used in preventing and treating cancer,...
-
Allie has bought a new apple orchard. The orchard has a single file of trees, numbered from 1 to N. Each tree has a certail number of ripe apples. Allie has a rule she wants to follow. She wants to...
-
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.
-
1. Yum! Brands is the result of a spin-off by PepsiCo, where it sold its fast-food chains KFC, Taco Bell, and Pizza Hut. Do you consider this spin-off successful? Why or why not? Explain. 2. Why is...
-
To construct a confidence interval for each of the following quantities, say whether it would be better to use paired samples or independent samples. a. The mean difference in weight loss between...
-
Scores on a certain IQ test are known to have a mean of 100 . A random sample of 60 students attend a series of coaching classes before taking the test. Let \(\mu\) be the population mean IQ score...
-
A sample of size \(n=100\) is used to test \(H_{0}: \mu \leq 20\) versus \(H_{1}: \mu>20\). The value of \(\mu\) will not have practical significance unless \(\mu>25\). The population standard...
-
The rejection region for a \(5 \%\) level test of \(H_{0}: \mu \geq 10\) versus \(H_{1}: \mu <10\) is \(\bar{X} <7.9\). Find the rejection region for a \(1 \%\) level test.
-
A process that manufactures steel bolts is supposed to be calibrated to produce bolts with a mean length of \(5 \mathrm{~cm}\). A sample of 100 bolts has a mean length of \(5.02 \mathrm{~cm}\). The...
-
Roberto has received various gifts over the years. He has decided to dispose of the following assets he received as gifts: a. In 1951, he received land worth $32,000. The donor's adjusted basis was...
-
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
-
Hi, could someone please help me with this. I need the letter to be nearly two hundred words. This is the assignment below: You are an architect who is working for Dream Homes Company in Toronto....
-
Discussion Board Post - Read the speech example from the textbook below. Then answer the questions in blood at the bottom. "As a veterinarian and owner of a small-animal practice, you work closely...
-
The Essentials of Technical Communication (Tebeaux & Dragga), Oxford U. Press, Third Edition - I. Please explain how a proposal is an argumentative or persuasive piece of writing -- and the four key...
Study smarter with the SolutionInn App