Disc Scheduling FCFS, SCAN or C-SCAN   Write a program that will  calculate the total head movement for either one of this algorithms (FCFS, SCAN or C-SCAN) for all test cases Your input file starts with the case number, number of tracks, starting track, and the sequence of track numbers it will be accessing //input file Case 1, 199, 53, 98, 183, 37, 122, 14, 124, 65, 67 Case 2, 199, 53, 98, 183, 37, 122, 14, 124, 65, 68 Case 3, 199, 53, 98, 183, 37, 122, 14, 124, 65, 69 Case 4, 199, 53, 98, 183, 37, 122, 14, 124, 65, 70 Remember the track starts at 0 A sample output file will look like the following.  FCFS algorithm Case 1, 640 Case 2, 641 Case 3, 642 Case 4, 643

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.2: Reading And Writing Character-based Files
Problem 6E: (Data processing) a. Write a C++ program that opens a file and displays its contents with line...
icon
Related questions
Question

Disc Scheduling FCFS, SCAN or C-SCAN

 

  1. Write a program that will  calculate the total head movement for either one of this algorithms (FCFS, SCAN or C-SCAN) for all test cases
  2. Your input file starts with the case number, number of tracks, starting track, and the sequence of track numbers it will be accessing
    //input file
    Case 1, 199, 53, 98, 183, 37, 122, 14, 124, 65, 67
    Case 2, 199, 53, 98, 183, 37, 122, 14, 124, 65, 68
    Case 3, 199, 53, 98, 183, 37, 122, 14, 124, 65, 69
    Case 4, 199, 53, 98, 183, 37, 122, 14, 124, 65, 70
  3. Remember the track starts at 0
  4. A sample output file will look like the following. 
    FCFS algorithm
    Case 1, 640
    Case 2, 641
    Case 3, 642
    Case 4, 643
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning