Question: This assignment is somewhat similar to the CPU scheduling assignment, excepting that it doesn't use threads, so it should be much easier to complete. Write
This assignment is somewhat similar to the CPU scheduling assignment, excepting that it doesn't use threads, so it should be much easier to complete. Write a program to simulate the application of different disk scheduling algorithms to a common input reference string. The algorithms to be simulated are SSTF FCFS and LOOK.Program Input and OutputYour program should take its input from a file, "input.txt The first line of the file will contain a single integer, equal to the number of tracks on the simulated disk. You should assume the head starts over track The remainder of the file will consist of a sequence of entries separated by linefeeds. Each entry represents the submission of a track request to the scheduler. The entries are of the form:s tWhere s and t are both positive integers ands is the number of milliseconds elapsed since the submission of the previous request and t is the track number requested. Keep in mind that requests will be received as other requests are being serviced.Your program should generate a table that, for each type of scheduler, prints the order in which each algorithm services the requests, the time of each service, which track is being served, and the total elapsed simulated time to service all requests. You should assume that the simulated disk head starts over track at the start of the simulation. Rather than measuring time directly, you should merely assume that it takes millisecond to traverse each track. Thus to move the head from track to track would require milliseconds of simulated time.Here is some sample input
Example OutputFCFSTime Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now TimeSERVICING track Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now TimeSERVICING track Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now TimeSERVICING track Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now Time Adding request Head @ Current target Pending requests are now TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track TimeSERVICING track FCFSTotal RunTime: Servicing Sequence was:
