Worked example 1
A sequential file on a magnetic tape stores 20,000 employee records. The system takes 0.8 ms to read a single record. Calculate the time taken, in seconds, to access the 15,000th record. State one assumption you have made.
Show solution outline
To access the 15,000th record sequentially, the system must read all records from the beginning up to that point.
Working:
- Number of records to read = 15,000
- Time per record = 0.8 ms
- Total time in milliseconds = 15,000 records * 0.8 ms/record = 12,000 ms
- Convert to seconds: 12,000 ms / 1000 = 12 seconds
Answer: 12 seconds.
Assumption: The time to read each record is constant and there are no other delays (e.g., from tape acceleration/deceleration or system interrupts).