Determine minute at which first customer arrives

Assignment Help Basic Computer Science
Reference no: EM1362568

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 to 4 minutes. Also, each customer is serviced in random integer intervals of 1 to 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 12-hour day (720 minutes) using the following algorithm:

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

b) At the first customer's arrival time:
Determine 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).

c) 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 to4 added to the current time). Now run your simulation for 720 minutes and answer each of the following:

a) What is the maximum number of customer in the queue at any time?

b) What is the longest wait any one customer experiences?

c) What happens if the arrival is changed from 1 to 4 minutes to 1 to 3 minutes?

Reference no: EM1362568

Questions Cloud

Nutritional consequences of lactose intolerance : Discuss the causes and possible nutritional consequences of lactose intolerance. How common is this condition?
Accounting for nonprofit versus for-profit expenditures : Assume a nonprofit has a restricted fund for capital asset purchases. Compare the journal entries for the cash purchase of a $10,000 computer by the nonprofit, to how the journal entry would look for this for-profit.
Explain training and career development : Show list three benefits of distance learning programs. Explain how they are beneficial to the organizations allowing their employees to partake in them.
Nursing or nutrition research : I need help in finding a recently to published nursing or nutrition research article on any topic and answer the following questions:
Determine minute at which first customer arrives : Choose a random integer between 1 and 4 to determine the minute at which the first customer arrives. What happens if the arrival is changed from 1 to 4 minutes to 1 to 3 minutes?
International tax planning : How exactly does international tax planning assist a US citizen avoid taxes? Discuss what you feel are the legal, ethical and fairness issues involved in doing this type of international tax planning.
Estimate degree of combined leverage : A Corporation manufactures skates. The Corporation income statement for 2004 is as follows;
Economic considerations-consumer products inc : Find specific retail companies that could potentially sell CPI's products, the markets that would be attractive, and some of the financial and economic considerations.
Majority of external financing by corporations : Determine which method of financing has traditionally made up the majority of external financing by corporations?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Macro running in response to form button

All of the following are events except: a macro running in response to a form button being clicked, changing the data in a cell, clicking on a control button or opening or closing an Excel workbook.

  Creating flowchart of data found on employee time cards

Create a flowchart depicting the following situations: The data found on employee time cards are keyed onto a hard disk before they are processed by a computer.

  Shannon-fano-elias code or arithmetic code for symbols

The binary sequence s = 111111111000000111111111111111100001 = 1^9,0^6,1^16,0^4,1 was generated by a stationary two-state Markov chain with transition probabilities p1|0 = 2p0|1 = 0.2. a Shannon-Fano-Elias code or an arithmetic code for 3-bit symb..

  Designing a 4-to-16 decoder using not gates

Draw 4-to-16 decoder by using components. You must not use any extra components.

  Explaining real-world group support system success stories

Identify one real-world Group Support System success stories (e.g., from vendor Web sites or from reports/articles) and describe them.

  Compare time complexity of convolution with kernel

Compare the time complexity of convolution with a n x n kernel when using: direct convolution with the 2-D mask, and separable kernel.

  Significant to control changes to asset baselines

Why is it significant to control changes to asset baselines? Explain why is labeling process approached hierarchically?

  Explaining visible and consistent management support

Illustrate visible and consistent management support. Establish privacy responsibilities. Privacy needs need to be incorporated into any position which handles personally identifiable information (PII).

  Explaining power over ethernet and transfer power over fiber

A recent article in industry magazine discussed the ability to transfer Power over Ethernet (PoE) and emerging technology that is able to transfer Power over Fiber (PoF).

  Write difference between logical and physical modeling

What is the difference between logical and physical modeling? Give three reasons why logical models are superior for structuring business requirements.

  Types of pre-created objects that can be used on web sites

Types of pre-created objects that can be used on Web sites. Describe the objects you find and what they are used for. Include links to the sites you used in your research.

  Explaining origins or genesis of wireless networking

Explain origins/genesis of wireless networking.

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