#include int main(void) { const double rpm = 7200.0; const double full_rotation_ms = 60000.0 / rpm; const double avg_seek_ms = 9.0; const double settle_ms = 1.0; printf("Hard Disk Drive Access Time Simulator\n"); printf("=====================================\n"); printf("RPM: %.0f, Full rotation: %.2f ms\n", rpm, full_rotation_ms); printf("Average seek: %.1f ms, Settle: %.1f ms\n\n", avg_seek_ms, settle_ms); double random_access = avg_seek_ms + settle_ms + 0.5 * full_rotation_ms; printf("Typical random I/O time: %.2f ms\n", random_access); printf("Sequential transfer much faster due to no extra seeks/rotations.\n"); int current_track = 0; int target_track = 100; double seek_time = 0.08 * (target_track - current_track) + settle_ms; double rot_delay = 0.3 * full_rotation_ms; double total = seek_time + rot_delay; printf("\nExample request: from track %d to %d\n", current_track, target_track); printf("Seek time: %.2f ms, Rotational delay: %.2f ms, Total: %.2f ms\n", seek_time, rot_delay, total); return 0; }