Question: Write a complete computer program using either C++, C#, or Java to calculate the average waiting time for a number of processes in a random

Write a complete computer program using either C++, C#, or Java to calculate the average waiting time for a number of processes in a random length queue with various random CPU execution burst times from 5ms to 50ms using the first-come-first-serve (FSFS) algorithm.

The random queue length can be any number from 2 to 100. Repeat or loop the calculation to find the average waiting time for each queue. That is, calculate the average waiting time for all the loops individual as well as the average waiting time for all the individual queues together. The number of times to repeat the loop may be any given number from 1 to 10,000,000.

You must not have any Magic Number written in your program. That is, queue length and number times to loop must not be hard-coded in your program. They can only define as #define NUM_LOOPS 1000 or const int NUM_LOOPS = 1000 and #define QUEUE_SIZE 5 or const int QUEUE_SIZE = 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!