my desired output is this:
Input number of process to simulate SJF: 4
Input burst time for each process:
P1 = 7
P2 = 4
P3 = 1
P4 = 4
Input Arrival Time for each process:
P1 = 0
P2 = 2
P3 = 4
P4 = 5
Now simulating SJF:
Time Process Running
1 P1
2 P1
3 P1
4 P1
5 P1
6 P1
7 P1
8 P3
9 P2
1O P2
11 P2
12 P2
13 P4
14 P4
15 P4
16 P4
Waiting Time:
P1 = 0
P2 = 6
P3 = 3
P4 = 7
Average Waiting Time = 4
--------------------------------------------
is any one familiar with non preemptive SJF?
i'm having a problem computing for the waiting time for each process given the arrival time and burst time. Also, the time process running part, i really don't have a clue what
to do.. does anybody have an idea?
I have attached my full code.