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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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