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

  Explaining dui and charges of domestic violence

You will be handling sensitive information and may end up in court as a technical or expert witness. How can things such as a DUI, charges of domestic violence and other items affect your career?

  State whether each reference is hit or a miss

Assume a cache has 16 1-word blocks and is initially empty. Placement is by direct mapping. Also, state whether each reference is a hit or a miss.

  How has configuration for connecting input-output changed

How has the configuration for connecting input/output (I/O) devices to computers on the motherboard changed since the late 1980s?

  Changing conditions significant influence on way health

What changing conditions do you think have the most significant influence on way the health information is managed today? Why?

  Evaluation process to seven-step acquisition model

Discuss in scholarly detail the acquisition evaluation process to the Seven-Step Acquisition Model.

  Cloud provider secure large amount of capital

Few organizations tend to prefer operating expense models. whether Cloud providers will continue to secure large amount of capital....or will equity firms stop their funding?

  Describe kinds of pc applications skills

Describe in scholarly detail the kinds of PC applications skills which important for working within a major organization? Also put yourself in the shoes of a manager and share your thoughts.

  High-level descriptions of customer-s expectations

It needs to have high-level descriptions of the customer's expectations and the criteria for success. You need to describe why these are the best choices and why alternatives will not work as well.

  Describe findings after conducting internet search for cde

The network administrator mentions that other ".cde" files have been sent through an FTP server to another site. Describe your findings after conducting an Internet search for ".cde" files.

  Business reprocess engineering-strategic information system

Some people may say that Business Reprocess Engineering (BPR) is special case of strategic information system, whereas, others may say opposite is true. Describe this statement in scholarly detail.

  Explaining mandatory access control implementation

How are Novell AppArmor and the Red Hat "targeted" SELinux policy similar? Is either a true Mandatory Access Control implementation. If not, explain why.

  Finding content of top of stack-call instruction is executed

Specify the content of PC, SP, and the top of the stack in the following situations: After the call instruction is executed.

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