Computers and Technology, 06.05.2020 07:08 jeff2852
Write a program that simulates a checkout line in a supermarket. A queue is FIFO, so enqueue at the tail of the queue, and dequeue at the head of the queue. The line will be a customer object linked list. Customer (objects) will arrive in random intervals from 1 to 4 minutes. Customers remain in the queue until they reach the head, and then they still remain until they are serviced — also determined by another random interval from I to 4 minutes. The arrival times and the service times are, then, integers between I and 4. Run the simulation for 720 minutes (a 12-hour day); times begin at 0 — start and end at 719). Use an algorithm similar to:
a. Choose a random number between 1 and 4 to determine when the first customer arrives, and display this time (I to 4). When this time (in minutes) arrives, add a customer to the queue (see also b below), and determine when the next random customer is to arrive, and display this time.
b. At each customer's arrival time: 1) determine the customer's service time (also between I and 4 minutes) when reaching the head of the queue, 2) enqueue the customer, and 3) schedule the arrival of the next customer (between 1 and 4 minutes hence), and display this time.
Answers: 2
Computers and Technology, 22.06.2019 23:30, elizabethburkha
Which text format is this, "the text is transcribed exactly as it sounds and includes all the utterances of the speakers. "?
Answers: 2
Write a program that simulates a checkout line in a supermarket. A queue is FIFO, so enqueue at the...
Chemistry, 13.10.2019 10:50
History, 13.10.2019 10:50
Physics, 13.10.2019 10:50
Mathematics, 13.10.2019 10:50