Fall 2002 CSCI 333 Quiz 5
Problem 1
Consider an old-fashioned unzoned disk
drive with the following characteristics.
- 20 GB total storage
- 10 surfaces
- 2048 cylinders
- no interleaving
- rotational speed of 10,000 rpm
- track-to-track seek time of 3 msec
- average seek time of 10 msec
The questions
Answer the following questions regarding the disk drive
described above.
- How many 512 byte sectors are on this disk drive?
- How many total tracks (on all cylinders) are on this disk drive?
- How many sectors are stored on each single track?
- How long, in msec, does it take this disk to rotate?
- 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)