Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Develop a simple checkout system. That system was so successful that they've decided to expand their operations by opening additional checkout lanes. Unfortunately, they are unsure of just how many lanes they need to add. Ideally, Cougar Mart would add enough lanes to satisfy expected demand. However, opening too many lanes would mean that they're paying checkers to staff empty lanes. Your goal is to develop a checkout lane simulation that can be used to determine the optimal number of lanes that Cougar Mart should have open.

Your program should simulate an entire day at Cougar Mart, in minutes. For this simulation, we will assume that Cougar Mart is open 12 hours a day. As this is a simulation, you don't actually need to run your program for 12 hours. Instead, consider the time span to be an integer, with each minute being a number. As such, 0 would indicate the start of the simulation, 1 would represent the first minute of the simulation, 2 the second minute, and so on.

Program Flow

Your simulation should operate as follows:

1. Prompt the user for the number of checkstands to simulate

2. Create a vector that contains the appropriate number of checkstands

3. Set the probability of a new customer arriving equal to 0.

4. For each minute in the simulation

a. Determine if a new customer has arrived.
i. Generate a random number between 0 and 5.
ii. If the random number is less than or equal to the probability of a new customer arriving (Step #3), go to Step 4.B.
iii. If the number is greater than the probability of a new customer arriving (Step #3), increment the probability of the new customer arriving by 1. Go to Step 4.C.

b. If a new customer has arrived, create a new customer whose arrival time is equal to the current simulation time and whose service time is a randomly generated number between 1 and 4. Next, try to find an empty checkstand. If one exists, place the customer in the line at that checkstand. If no empty checkstand exists, randomly select a checkstand for the customer to enter.

c. For each checkstand in the simulation:
i. If there is at least one customer in the checkstand, go to 4.C.II. Otherwise, go back to 4.C.
ii. If the first customer in line has not received a departure time, calculate one. Departure time = arrival time + service time.
iii. If the total time elapsed is greater than the first customer's departure time, then the customer has completed the checkout process. Remove them from the queue.
d. Increment the elapsed time in the simulation

5. After the simulation completes, write the results to a CSV file in the following format:

, ,

Also include the total number of customers generated during the simulation at the top of the CSV file. Note that an example CSV file will be included with this assignment description. I have provided a CsvWriter class to aid in the construction of CSV files.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9132487
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

The following few machines are given informal

The following few machines are given informal descriptions. Decide whether they are of CISC or of RISC design, and provide a short description of why. a) Machine A has over 300 instructions, many of which are executed at ...

Task 1create an array that holds a 20 random integers

Task 1: Create an Array that holds a 20 random integers between 1-50. Create an iterator that will return the memory address and value for each integer present in the Array. Task 2: Update Assignment 1 Task 2. Pass the v ...

On a single diagram illustrate the following using the uml

On a single diagram, illustrate the following using the UML notation for objects, links and messages. (a) An object of class Window, with no attributes shown; (b) An object of class Rectangle with attributes length and w ...

Nfs allows the file system on one linux computer to be

NFS allows the file system on one Linux computer to be accessed over a network connection by another Linux system. Discuss the security vulnerabilities of NFS in networked Linux systems, and possible mitigation solutions ...

Penetration testing is a technique used to identify

Penetration testing is a technique used to identify security weaknesses in your network. Discuss a type of penetration testing and the different methods utilized to recognize vulnerabilities in your network.

All rsa cryptosystem has public key n 35 and e 7 messages

All RSA cryptosystem has public key N = 35 and e = 7. Messages are encrypted one letter at a time, converting letters to numbers by A = 2, B = 3, .... Z = 27, space = 28. Showing your working, encrypt the message: BE GOO ...

1 a router operates at which osi layer application

1. A router operates at which OSI layer? Application Presentation Session Transport Network Data Link Phsical 2. Suppose application data of size X bytes is transmitted from system A to system B via the OSI layers and th ...

A decision maker has ordered every commodity in walmart

A decision maker has ordered every commodity in Walmart alphabetically according to the commodity's name. Every time when he needs to choose from several commodities, he always choose the second one according to his orde ...

A sample of a compound is decomposed in the laboratory and

A sample of a compound is decomposed in the laboratory and produces 330 g carbon, 69.5 g hydrogen, and 220.2 g oxygen. Calculate the empirical formula of the compound. Express your answer as an empirical formula.

An inhaled anesthetic of formula c2hbrclf3 is unusual in

An inhaled anesthetic of formula C2HBrClF3 is unusual in that it contains three different halogen atoms but no oxygen. What is its pressure in atmospheres at 27°C if its density is 0.187 g/L at that temperature?

  • 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