I am doing FCFS, SJF preemptive, SJF non-preemptive, Priority FCFS, RR scheduling algorithms using c++. Assume that I have 3 jobs stream such as job stream: (A,0,0,10,2,10,3), (B,0,0,10,2,5,2), (C,0,15,15,10,15,5)
A job will be represented as follows:
(job id, priority, arrival time, CPU1, IO1, ..., CPUn, IOn)
I know the concept of scheduling algorithms. I have already do working on paper. I have difficulties in converting them into programming.
My programs need to do the following thing.
User will be prompted for:
Job stream source:
if file, prompt for file name
if random generation,
jobid's should be A, B, C, ..., , etc.
prompt for number of jobs,
prompt for min and max of ranges for:
number of CPU/IO burst pairs
CPU burst size
IO burst size
Scheduling algorithm (display choices) -
prompt for parameters as needed, i.e. quantum size for RR
Suppress table output? Hit y to suppress, otherwise hit Enter.
I need to calculate
Summary of user's input info
Job stream in above format, one job per line
Scheduliing trace table (unless supressed)
CPU utilization =
IO utilization =
Avg. turnaround time =
Waiting time (in ready queue): A: B: C:
Avg. waiting time =
Could you give me some idea how to start with. I will start writing it today and keep posting my post.