Question: write the code in java and use an input file please 2. This problem is to simulate scheduling CPU jobs by using a priority queue

 write the code in java and use an input file please

write the code in java and use an input file please

2. This problem is to simulate scheduling CPU jobs by using a priority queue to be built. Your program to be written for the simulation should run in a loop, each iteration of which corresponds to a time slice for the CPU. Each job is assigned a priority, which is an integer between -10 (highest priority) and +10 (lowest priority), inclusive. From among all jobs waiting to be processed in a time slice, the CPU, the CPU must work on a job with highest priority. In this simulation, each job will also come with a length value, which is an integer between 1 and 100, inclusive, indicating the number of time slices that are needed to process this job. For simplicity, you may assume jobs cannot be interrupted - once it is scheduled on the CPU, a job runs for a number of time slices equal to its length. Your simulator must output the name of the job running on the CPU in each time slice and must process a sequence of commands, one per time slice, each of which is of the form "add name with length n and priority" or "no new job this slice" A command line user interface has to be provided as follows: "Enter your input file name:" "Display the input before:"*display the input integers following a statement/ "Display the output after the operation:"display the resulting output on the screen The program is to be submitted to the directory in "handin" *Provide a README file with specific instructions for compilation and execution for the grader to follow, and any notes you want to add

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!