subject

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.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
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
image
Computers and Technology, 23.06.2019 02:30, noah2o2o
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
image
Computers and Technology, 23.06.2019 04:31, Remba
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
You know the right answer?
Write a program that simulates a checkout line in a supermarket. A queue is FIFO, so enqueue at the...

Questions in other subjects:

Konu
Physics, 13.10.2019 10:50
Konu
Mathematics, 13.10.2019 10:50