ICS 160E / EECS 114 - Programming Project 3, 50 Points
Due: Friday, May 27, 2005, at 7pm, using the Checkmate Submission System.

In this project you are to build a Java program that schedules simulated CPU jobs. Your program 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 -20 (highest priority) and 19 (lowest priority), inclusive. From among all jobs waiting to be processed in a time slice, 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 one the following forms:

Note: you may use the following class in your program:

You should read commands from System.in and output the name of the job running in each time slice to System.out.