Computers and Technology
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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:00, tay9122
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
image
Computers and Technology, 23.06.2019 10:00, uwunuzzles
How do i delete my account on this because i didn't read this agreements and also i put age at xd
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, jadaroyval
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
image
Computers and Technology, 24.06.2019 15:30, livagrace
Emma is using an artificial intelligence system, which contains information on botany, to identify a type of plant from an image. what type of ai is emma using?
Answers: 1
Do you know the correct 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
Mathematics, 05.05.2020 09:57