Write program which simulates checkout queue object

Assignment Help Programming Languages
Reference no: EM1371248

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 using the following algorithm:

Choose a random integer between 1 and 4 to determine the minute at which the first customer arrives. At the first customer's arrival time:

Determine the customer's service time (random integer from 1 to 4);
Begin servicing the customer;
Schedule the arrival time of the next customer (random integer 1 to 4 added to the current time).
For each minute of the day:
If the next customer arrives,
Say so,
Enqueue the customer; ("push" onto the back of the queue)
Schedule the arrival time of the next customer;
If the service was completed for the last customer;
Say so,
Dequeue the next customer to be serviced ("pop" off the front of the queue)

Determine the 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:

What is the maximum number of customers in the queue at any time?

What is the longest wait any one customer experiences?

What happens if the arrival interval is changed from 1-4 minutes to 1-minutes?

Reference no: EM1371248

Questions Cloud

How wal-mart incorporates the goals of shareholders : Strategic Management - Please analyze how Wal-Mart Incorporates the goals of its shareholders
Profit-maximization long-run supply curve : Using the firms marginal cost curve, compute the profit-maximization long-run supply curve for typical retailer. Compute the average total cost curve for the typical gasoline retailer, and determine that average total cost are less than price at the..
Explain the concept of demand with the examples : In economics, demand for a product is considered downward sloping. This implies that quantity demanded rise when price reduce.
Discuss external environment for wal-mart : External analysis enables companies to identify threats and opportunities and threats are conditions that preclude companies from functioning and making profits.
Write program which simulates checkout queue object : Write program which simulates checkout line at supermarket. Line is queue object. Customers (i.e., customer objects) arrive in random integer intervals of 1-4 minutes.
Information about marginal revenue : Consider the following demand schedule. Does it apply to the perfectly competitive firm? Calculate marginal and average revenue.
Create seven-bit adder in logicworks : Create 7-bit adder. Inputs are X[6..0], Y[6..0], and Cin. Outputs are S[6..0] = X[6..0] + Y[6..0] + Cin, where + is arithmetic addition. Implement adder in LogicWorks. The parts you can use include.
Different types of product development teams : Contrast the different types of product development teams and describe the different situations when each type would be preferable
Compute calvin profit-maximizing output level : Compute  Calvin's profit-maximizing output level. Compute the Calvin's economic profits at this activity level. Is this activity level sustainable in long run?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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