Write program simulate checkout line at supermark

Assignment Help Programming Languages
Reference no: EM1370980

Write a program that simulates a checkout line at a supermarket. The line is a queue object. Customers( i.e customer objects) arrive in random integer intervals of 1-4 minutes. Also each customer is served in random integer intervals of 1-4 minutes. Obviously, the rates need to be balanced. If the average arrival rate is larger than the average service rate, the queue will grow infinitely. Even with " Balanced" rates, randomness can still cause long lines. Run the supermarket simulation for a 12 hour day(720 minutes) using the following algorithm:

1) choose a random integer between 1 and 4 to determine the minute at which the first customer arrives.

2) At the first customer's arrival time:
Determine customer's service time (random integer from 1 to 4);
Begin servicing the customer;
Schedule arrival time of next customer (random integer 1 to 4 added to the current time).

3) For each minute of the day;
If the next customer arrives,
Say so,
Enqueue the customer;
Schedule the arrival time of the next customer;
If service was completed for the last customer;
Say so
Dequeue next customer to be serviced
Determine customer's service completion time( random integer from 1 to 4 added to the current time).
Now run your simulation for 720 minutes and answer each of the following:

a) What's the maximum number of customers in the queue at any time?
b) What's the longest wait any one customer experiences?
c) What happens if the arrival interval is changed from 1-4 minutes to 1-3 minutes?

Reference no: EM1370980

Questions Cloud

Illustrate what products or services that made by company : Explain how much and why. This could include things such as mergers, innovative marketing, etc. Illustrate what products and/or services that made by this company.
Contractionary monetary policy : An economy is facing inflationary gap shown in the ac­companying diagram. To eliminate gap, should the central bank use expansionary or contractionary monetary policy?
Advantages and disadvantages of using presentation aids : Describe two different presentation aids used in group presentations identify the advantages and disadvantages of your selected aids when used in group presentations.
Illustrate james opportunity cost of producing chickens : Illustrate what is James' opportunity cost of producing chickens. Which person has an absolute advantage in which activities.
Write program simulate checkout line at supermark : Write the program which simulates checkout line at supermarket. Line is a queue object. Customers( i.e customer objects) arrive in random integer intervals of 1-4 minutes.
How far behind the train is the automobile : The automobile afterwards undergoes a uniform acceleration of -4 m/s2 because of a red light and comes to rest. It remains at rest for 54.6s and next accelerates back to a speed of 25.6m/s at a rate of 2.85m/s2.
Determining the present value : You have just won a lottery! You will receive $50,000 a year beginning one year from now for twenty years. If your required rate of return is 10 percent,
Why is depreciation of capital good a cost of society : Why is depreciation of capital good a cost of society. In illustrate what ways does a person's health depreciate. Why might older people's health care expenditures increase in Grossman model even though their desired health stocks may be lower.
Illustrate what is value of trumbull equity : Illustrate what is value (in millions) of Trumbull's equity if it is viewed as an option. Illustrate what is yield on Trumbull's debt.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create class to calculate perimeter and area rectangle

Create class Rectangle. The class has attributes length and width, each of which defaults to 1. It has read-only properties that calculate the Perimeter and the Area of the rectangle.

  Explain relationship between xbrl and semantic web

How do HTML 5, RDF (Resource Description Framework), and OWL (Web Ontology Language) relate to the semantic web? Explain the relationship between XBRL and the semantic web.

  Create a class for performing arithmetic with fractions

Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. 1/2+2/3+3/4.......+98/99+99/100.Use integer variables to represent the private data of the class

  Find out probability at any given time user transmitting

Assume there are 20 users. Determine probability that at any given time, exactly n users are transmitting simultaneously. Determine the probability that there are 11 or more users transmitting simultaneously.

  Write script in fedora to automate complex system task

Write a script in fedora 10 that will automate a complex system task. The task I have chose is one that will determine the processes that are consuming system resources.

  Write program using to take input two integers by while loop

Write a program which uses while loops to perform following steps: Prompts user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum).

  Create internal representation of polynomial is array

Create class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent.

  Program to calculate area of two-dimensional shape

Implement the Shape hierarchy shown in following figure. Each TwoDimensionalShape should contain method getArea to calculate the area of the two-dimensional shape.

  Sketch state diagram for machine using sw

Sketch the State Diagram for machine using any SW (i.e. MS Visio).: Print out your VHDL Code and Simulation waveforms for you design 3 Points: Print out your VHDL Code for your self-checking Test Bench

  Write the application using the one-dimensional array

Write the application using the one-dimensional array which inputs ten numbers from user, each number can be between and 100, inclusive.

  Design psuedocode program to calculate amount

Design a psuedocode program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day.

  Program-calculate power loss-transmitted-power generating

Write a program to calculate power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generating station.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd