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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
3pointsyou've found an image you want to insert into your slide presentation. youwant to make the image look more gray so that it looks like an older imagewhat would you need to adjust? 0.00o a. sizeo b. hueo c. contrasto d. tones
Answers: 2
question
Computers and Technology, 24.06.2019 12:00
How can we take picture in this app
Answers: 1
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
question
History, 18.11.2019 09:31
Questions on the website: 13722367