subject

In c++! 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-4 minutes, also, each customer is served in random integers intervals of 1-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 2-hour period (120 minutes) using the following algorithm: i wouls also appreciate it if you could use queue as an array and not stacks.1). choose a random integer from 1 to 4 to determine the minute at which the first customer arrives2). at the first customer’s arrival time: a) determine customer’s service timeb) begin servicing the customer; c) schedule arrival time of next customers3). for each minute of the daya) if the next customer arrives, say so, enqueue the customer, and schedule the arrival time of the next customer. b) if the services was completed for the last customer, say so, dequeue next customer to be serviced and determined customer’s service completion time (random integer 1 – 4 added to the current time).now run your simulation for 120 minutes, and answer each of the following: a. what 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 interval is changed from 1-4 minutes to 1-3 minutes?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
question
Computers and Technology, 22.06.2019 07:30
An endless cycle of creation and response on the internet is called
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
Adrawing that places all lines parallel to the z axis at an angle from the horizon is 99 ! a. an oblique drawing b. a perspective drawing c. an auxiliary view d. a one-point perspective drawing
Answers: 2
question
Computers and Technology, 24.06.2019 10:30
Which of the following types of software is most applicable to the promotion of new products through advertising? a.databases b. spreadsheets c. web design programs d. word processing tools
Answers: 2
You know the right answer?
In c++! write a program that simulates a checkout line at a supermarket. the line is a queue object...
Questions
question
Mathematics, 10.02.2021 23:10
question
Biology, 10.02.2021 23:10
question
Health, 10.02.2021 23:10
question
Mathematics, 10.02.2021 23:10
question
History, 10.02.2021 23:10
question
Mathematics, 10.02.2021 23:10
question
Chemistry, 10.02.2021 23:10
question
Mathematics, 10.02.2021 23:10
Questions on the website: 13722363