situation: computer science laboratory. On an average day, about 10 students are working in the lab at any given hour.
shared a printer.
The time taken for printing tasks varies from one another depending on the pages volumes printed by students. Students can send printing instructions from any terminals attached to the same network of the printer. Hence, many students can do so at once. Below is the six printing job
Task ID T1 T2 T3 T4 T5 T6
Table 1
Execution Time 3 unit time 5 unit time 2 unit time 4 unit time 6 unit time 1 unit time
Arrival Time to t1 t3 t6 t10 t14
Explain how can the printer handle the many instructions. Show your solution in terms of flowchart and full program. Make sure your program uses dynamic queue as the data structure and simulates the whole executions till completion. Your program should print the time when the print job from each student started and their waiting time. It also needs to calculate the time needed to complete all printing jobs and the average waiting time.
Comments
Leave a comment