i need help..

No replies
jarg023
Offline
Last seen: 8 years 29 weeks ago
Joined: 2011-02-20
bOt Points: 54

this is a sample output for the program:

 

 Ex. SJF

             Process                      Burst Time

                  P1                                6

                  P2                                8

                  P3                                7

                  P4                                3

 

Gantt Chart:

0***3******9*******16********24

 

Turnaround Time = Terminated – Arrival

 

Turnaround Time:

P1 = 9 – 0 =    9 milliseconds

P2 = 24 – 0 =              24 milliseconds

P3 = 16 – 0 = 16 milliseconds

P4 = 3 – 0 =    3 milliseconds

Ave turnaround: (9+24+16+3)/4 =13 milliseconds

 

 

Waiting Time = Turnaround – Burst

 

Waiting time:

                        P1 = 9-6 =       3 millisecond

            P2 = 24-8=      16 milliseconds

            P3 = 16-7=      9 milliseconds

            P4 = 3-3=        0 milliseconds

Ave. Waiting Time = (3+16+9+0) / 4 = 7 milliseconds

Note:

You should tell the user to enter how many she wants to process(the process must not exceed in 20)

The Arrival time should only be zero.

Use a function declaration in sorting the Gantt Chart(use Bubble Sort it should be from lowest to highest)

The Burst time must not have a negative numbers and muts not exceed 10.

the program must use a pointer,array and function declaration(the function declaration is for the sorting of the gantt chart)

 

Thank you :D