Question: Please write in JAVA . Write a program that implements the following disk-scheduling algorithms: FCFS SSTF SCAN C-SCAN LOOK C-LOOK There is similar code online
Please write in JAVA. Write a program that implements the following disk-scheduling algorithms: FCFS SSTF SCAN C-SCAN LOOK C-LOOK
There is similar code online but please do not submit if it is incorrect. I asked this question and someone gave me code that did not work. Include lots! of comments and add screenshots of output of it working on your machine. Please don't waste my question by answering with the wrong information. The conio.h header doesn't work for my mac so please add something else instead DO NOT forget the screenshots of it working on your machine so I know you read everything and got it to work and didn't just paste random code.
Your program will service a disk with n cylinders numbered 0 to n-1. The program will read a data file (input.txt). The first entry in the data file is the number of cylinders for your disk. The next entry is the cylinder number the disk position at the beginning of the simulation. Next, comes a line with a string of numbers representing the numbers of cylinders with I/O requests and service them according to each of the algorithms listed above. It will output the total amount of head movement required by each algorithm. The output should look something like the following:
For FCFS, the total head movement was xxx cylinders.
For SSTF, the total head movement was xxx cylinders.
For SCAN, the total head movement was xxx cylinders.
For C-SCAN, the total head movement was xxx cylinders.
For LOOK, the total head movement was xxx cylinders.
For C-LOOK, the total head movement was xxx cylinders.
The data in this first set is that used on pages 447 451 in your text and may be used to check your code. Then your program will read a second similar set of data from the same file and run that. Note that the data second set has different number of cylinders. Please make extensive comments explaining as much as possible Do any of the algorithms look especially good or bad? Data will be posted below.
* Data *
200 53 98 183 37 122 14 124 65 67 1000 250 100 400 325 290 650 222 850 250 270 150
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
