Assume you have a hard disk with the following specs:
• Has 4 platters
• Has 4096 tracks per platter surface
• Has 512 sectors per track
• Has 256 bytes per sector
• Rotates at 8,00 rpm
• Average seek time: 4 msec

Write a program that roughly simulates the hard disk described above. In your simulation, number the tracks from 1 –to 4096 with track 1 being the outer most track and track 4096 being the inner most track. Sectors should be numbered from 1 to 512 with adjacent numbers indicating adjacent sectors (sectors 1 and sector 512 are also adjacent). For simplicity, we will assume that a read request is generated in terms of only two values (x, y) which represent the track and sector numbers to be read (here we’re ignoring the various platters and are focusing on just one surface). For example, sector (1034, 67), refers to the 67th sector on track 1034. Given this description, and assuming the read/write heads are initially positioned at position (35, 500) your program should allow a user to enter a set of 10 requests (where a request indicates a sector that needs to be read or written and is represented as a pair as just specified), and calculate the exact seek and latency time needed to service each request based on the order the requests were entered. Seek time can be calculated by computing the distance between the position( track) the read write heads are on and the track they need to move to. Calculating latency involves a few more steps. To calculate latency, you must first calculate the seek time in order to know how long it will take to move the heads to the right track. Then, knowing which the sector was under the head it moved, and the rotational speed, your program should compute the sector which will be under the after the move. Finally, you can compute the latency, or the time left for the correct sector to arrive under the read/write head.

If anyone knows the code contact me on
<email snipped>

Votes + Comments
Try alt.noobs.homework.flunk.flunk.flunk
9 Years
Discussion Span
Last Post by mvmalderen

Please read the announcements and sticky threads at the top of this forum - there you'll see that we don't do your homework for you.

Take a stab at it, post your code, ask questions about the problems you encounter, and we'll help you to find your solution.


Yup, first read the forum rules and by the way people here usually don't respond to questions like: 'Please I want someone to help me'

You need to show us what you've done so far (forum rules), it's a nice assignment and it isn't too difficult, so give it a shot, ask specific questions about what exactly you don't understand and we'll help you :) to get a step nearer to the solution ...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.