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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:00, seddy86
Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". any value that is the same as the immediately preceding value is considered a consecutive duplicate. in this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. note that the last 3 is not a consecutive duplicate because it was preceded by a 7. write some code that uses a loop to read such a sequence of non-negative integers , terminated by a negative number. when the code finishes executing, the number of consecutive duplicates encountered is printed. in this case, 3 would be printed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system. in); is given.
Answers: 1
image
Computers and Technology, 23.06.2019 03:10, nxusasmangaliso8780
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
image
Computers and Technology, 23.06.2019 14:00, uday50
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
image
Computers and Technology, 24.06.2019 00:40, iamsecond235p318rq
To maintain clarity and focus lighting might be needed
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 in other subjects:

Konu
Business, 14.02.2021 02:10
Konu
Spanish, 14.02.2021 02:10