Memory Management Simulation
While waiting, the next CLASS A job is run.
Following: Generate a random number I. (Please write the program so that a different SEED may be used each time.)
I is an integer between 0 and 200.
CASE 1: 0 <= I <= 49
A job has entered the system.
1.1 0 <= I <= 25 Class A job; enter Queue A.
1.2 26 <= I <= 39 Class B job; enter Queue B.
1.3 40 <= I <= 49 Class C job; enter Queue C.
CASE 2: 50 <= I <= 100
Job has finished execution.
2.1 0 <= I <= 75 Partition A is now empty.
2.2 76 <= I <= 89 Partition B is now empty.
2.3 90 <= I <= 100 Partition C is now empty.
The three queues should be implemented as linked structures. If a partition becomes empty and there is no job that can be run in it, generate the next random number and continue. Repeat for 100 iterations, and at every fifth iteration, print the following information:
a) Current state of each queue
b) Current state of each partition
c) How many jobs of each class have been run so far.
B. Now repeat the same problem but use only one queue for all jobs and execute it for 100 iterations. Print out the same results so that comparisons of the results may be made. These results will be discussed in a summary statement accompanying your final project. See criteria sheet for the grading scheme for the project.