Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a program that simulates a checkout line at a supermarket.? The line is queue object. Customers (i.e., customer objects) arrive in random integer intervals of from 1 to 4 minutes. Also, each customer is serviced in random integer intervals of from 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 a 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, do the following:

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, consider the following:

If the next customer arrives, proceed as follows:

Say so.

Enqueue the customer.

Schedule the arrival time of the next customer.

If service was completed for the last customer, do the following:

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 minute and answer each of the following:

a) What time is the maximum number of customers 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?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9902431

Have any Question?


Related Questions in Computer Engineering

Explain how the company newmans own brand fulfills the

Explain how the company Newman's Own brand fulfills the definition of a business for profit and a non-profit business at the same time. Consider in the response the functions of business, entrepreneurship and production ...

Explain why a successful information security program is

Explain why a successful information security program is the shared responsibility of an organizations three communities of interest.

Software engineering software architecture questioncan

(Software engineering (Software Architecture) question) Can someone explain how a system's decomposition into components is driven by the system's features/requirements. Also, how can this decomposition be used to determ ...

What are the critical issues we must think about while

What are the Critical Issues we must think about while designing a Lexical Scanner? The results of that development, e.g., discuss both process and product.

Software design processquestion what are the best practices

Software Design Process Question: What are the best practices in writing program? Describe each one briefly. Noe: This question needs to be research. The book may all of the beat practice listing.

In a large university 6 of students live in dormitories a

In a large university, 6% of students live in dormitories. A random sample of 14 students is selected. What is the probability that the sample contains more than five students who do not live in the dormitories?

Suppose a life insurance company sells a 230000 one-year

Suppose a life insurance company sells a $230,000 ?one-year term life insurance policy to a 20?-year-old female for ?$330. The probability that the female survives the year is 0.999642. Compute and interpret the expected ...

A string in c is simply an array of characters with the

A string in C++ is simply an array of characters with the null character(\0) used to mark the end of the string. C++ provides a set of string handling function in as well as I/O functions in . With the addition of the ST ...

How does having an understanding of spreadsheet software

How does having an understanding of spreadsheet software help you succeed in your personal or professional life?

Question suppose you have to design a mobile application to

Question : Suppose you have to design a mobile application to control your microwave over internet. Define the objective, assumptions and Interface Metaphors of this application.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As