Fall 2002 CSCI 333 Quiz 5

Problem 1

Consider an old-fashioned unzoned disk drive with the following characteristics.

The questions

Answer the following questions regarding the disk drive described above.

  1. How many 512 byte sectors are on this disk drive?
  2. How many total tracks (on all cylinders) are on this disk drive?
  3. How many sectors are stored on each single track?
  4. How long, in msec, does it take this disk to rotate?
  5. What is the average time, in msec, required to read a random sector of data from the disk?

Problem 2

Write a C++ subroutine which is passed an istream that has been opened to this file. This routine should attempt to read an integer from the file. It should return -1, if the read request fails or reads a negative number. Otherwise, it should return the number it reads.

Here is a header for your function:

int ReadOne(istream NumS)