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

  Write html form that prompts user to enter value

Write an HTML form that prompts the user to enter a value. In PHP, write a script to determine whether the value contains an integer , a decimal-place number.

  Design logic for application for company-breakdown-payroll

Design the logic for an application for a company that wants a report containing a breakdown of payroll by department.

  Write and implement generic set class with attributes

Write and implement the generic Set class with attributes you find essential and with the following methods. Set class has nonduplicate elements.

  Write script to get gross sales for each employee by xhtml

Use a one-dimensional array to solve the folloing problem: Write a script (using an array of counters) that obtains the gross sales for each employee through an XHTML form and determines how many of the salespeople earned salaries

  Design function to accept two integer values

Design function named max that accepts two integer values as arguments and returns the value that is the greater of the two. for example if 7 and 12 are passed as arguments to the function the function should return 12.

  Write program prompts to enter three sides of triangle

Write a program which prompts the user to enter three sides of a triangle and your program will display the three sides and its category of either equilateral, isosceles or all unequal.

  Write a program that uses the curve class hierarchy

Write a program that uses the curve class hierarchy. The program should define several different objects, output their area, circumference, etc. It should also use the printcurve function.

  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.

  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.

  Write program using getline command

How would you write a program using the getline command, prompting the user to enter their first and then their last name. Also, using a float variable to enter their weight in lbs and height in inches.

  Program which accepts candy name-price per pound

A program which accepts the candy name (for example, "chocolate-covered cherries"), price per pound, and number of pounds sol in average month, and displays item's data only if it is best-selling item.

  Hubspot: inbound marketing and web 2.0

Hubspot: Inbound Marketing and Web 2.0

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