Syspro

Date post:04-Sep-2014
Category:
View:128 times
Download:1 times
Share this document with a friend
Transcript:

Sr. No 01.

Assignment NameWrite the simulation program for scheduling algorithm using FCFS. The arrival time and first CPU bursts of different jobs should be input to the system. The output should give the Grant chart and Waiting time for each process and average times. Write the simulation program for scheduling algorithm using FCFS. The arrival time and first CPU bursts of different jobs should be input to the system. The output should give the Gantt chart and Turnaround time for each process and average Turnaround time. Write the simulation program for non- preemptive scheduling algorithm using SJF. The arrival time and first CPU bursts of different jobs should be input to the system. The output should give the Grant chart and Waiting time for each process and average times Write the simulation program for non-preemptive scheduling algorithm using SJF. The arrival time and first CPU bursts of different jobs should be input to the system. The output should give the Grant chart and Turnaround Time for each process and average time. Write the simulation program for non-preemptive scheduling algorithm using Priority. The arrival time, first CPU bursts and process priority of different jobs should be input to the system. The output should give the Grant chart and Waiting Time for each process and average times Write the simulation program for non-preemptive scheduling algorithm using Priority. The arrival time, first CPU bursts and process priority of different jobs should be input to the system. The output should give the Grant chart and Turnaround Time for each process and average times Write a simulation program for disk scheduling using FCFS algorithm. Accept total number of disk blocks, disk request string, direction of head moment and current head position from the user. Display the list of request in the order in which it is Served. Also display the total number of head moments

02.

03.

04.

05.

06.

07.

ASSIGNMENT NO :-1#include #include void main() { int i,n,ar[10],b[10],m,sum=0,t; float avg; clrscr(); printf("\n ** Enter The Number of Processes ==>> "); scanf("%d",&n); printf("\n ** Enter The Processs / CPU Arival Time & CPU Burst Time ==>> \n "); for(i=1;i> 3 ** Enter The Processs / CPU Arival Time & CPU Burst Time ==>> 1 24 2 3 3 3 **************************************************** ** Gantt Chart ** --------------------| | p1| p2| p3 --------------------| *************************************************** ** Avg Turn arround Time ** For p1 ==>> For p2 ==>> For p3 ==>> 24 27 30

** Avg Turn Arround Time ==>> 27.000000

ASSIGNMENT NO :-2#include #include void main() { int i,n,ar[10],b[10],m,sum=0,t; float avg; clrscr(); printf("\n ** Enter The Number of Processes ==>> "); scanf("%d",&n); printf("\n ** Enter The Processs / CPU Arival Time & CPU Burst Time ==>> \n "); for(i=1;i> 4 ** Enter The Processs / CPU Arival Time & CPU Burst Time ==>> 1 12 2 3 3 8 4 5 *************************************************** ** Gantt Chart ** --------------------| | p1| p2| p3| p4 --------------------| *************************************************** ** Avg Waiting Time ** * For p1 ==>> * For p2 ==>> * For p3 ==>> * For p4 ==>> 0 12 15 23

** Avg Waiting Time ==>> 12.500000

ASSIGNMENT NO :-3#include #include void main() { int p[10],a[10],b[10],wt[10],i,j,t,t1,n,w=0,at=0,c[10],s=0; float avg; clrscr(); printf("\n ** Enter The Number of Process ==>> "); scanf("%d",&n); for(i=0;i Bust Time ==>> 6 Name ==>> 2 Arrival Time ==>> Bust Time ==>> 8 Name ==>> 3 Arrival Time ==>> Bust Time ==>> 7 Name ==>> 4 Arrival Time ==>> Bust Time ==>> 3 0 0 0 0

** Gantt Chart ** -----------------------| p4| p1| p3| p2 -----------------------************************************************************** ** Process 4 0 1 3 3 9 2 0 8 16 ************************************************************** ** ** Avg Wating Time ** ** Avrage Waiting Time ==>> 7.000000 ************************************************************** *** 0 7 0 6 Arrival Time 0 Bust Time Wait Time 3

ASSIGNMENT NO :-4#include #include void main() { int p[10],a[10],b[10],wt[10],i,j,t,t1,n,w=0,at=0,c[10],s=0; float avg; clrscr(); printf("\n ** Enter The Number of Process ==>> "); scanf("%d",&n); for(i=0;i> 12 Name ==>> 2 Arrival Time ==>> Bust Time ==>> 3 Name ==>> 3 Arrival Time ==>> Bust Time ==>> 8 Name ==>> 4 Arrival Time ==>> Bust Time ==>> 5 0 0 0 0

************************************************************** ** Gantt Chart ** -----------------------| p2| p4| p3| p1 -----------------------************************************************************** ** Process 2 0 4 3 3 8 1 0 12 16 ************************************************************** ** ** Avg Turn Around Time ** ** Avrage Turn Arround Time ==>> 13.750000 ************************************************************** ** 0 8 0 5 Arrival Time 0 Bust Time Wait Time 3

ASSIGNMENT NO :-5#include #include void main() { int p[10],a[10],pr[10],b[10],wt[10],i,j,t,t1,n,w=0,at=0,c[10],s=0; float avg; clrscr(); printf("\n ** Enter Number of Jobs in Ready Queue ==>> "); scanf("%d",&n); for(i=0;i 0 ** Enter Proccess Bust Time ==>> 10 ** Enter Priority of Job ==>> 3 ** Eenter Proccess Number ==>> 2 ** Enter Proccess Arrival Time ==>> 0 ** Enter Proccess Bust Time ==>> 1 ** Enter Priority of Job ==>> 1 ** Eenter Proccess Number ==>> 3 ** Enter Proccess Arrival Time ==>> 0 ** Enter Proccess Bust Time ==>> 2 ** Enter Priority of Job ==>> 5 ** Eenter Proccess Number ==>> 4 ** Enter Proccess Arrival Time ==>> 0 ** Enter Proccess Bust Time ==>> 1 ** Enter Priority of Job ==>> 4 ** Eenter Proccess Number ==>> 5 ** Enter Proccess Arrival Time ==>> 0 ** Enter Proccess Bust Time ==>> 5 ** Enter Priority of Job ==>> 2 ************************************************************** ** Gantt Chart ** -----------------------| p2| p5| p1| p4| p3 -----------------------************************************************************** Process Arrival Time Bust Time Priority Wating Time 2 1 5 2 1 3 4 4 0 0 0 1 0 6 0 16 1 10 5 1

3 0 2 5 17 ************************************************************** ** Avg Wating Time ** ** Avrage Waiting Time ==>> 8.000000 **************************************************************

ASSIGNMENT NO :-6#include #include void main() { int p[10],a[10],pr[10],b[10],wt[10],i,j,t,t1,n,w=0,at=0,c[10],s=0; float avg; clrscr(); printf("\n ** Enter Number of Jobs in Ready Queue ==>> "); scanf("%d",&n); for(i=0;i> 5 ** Enter Priority of Job ==>>2 ** Eenter Proccess Number ==>> 2 ** Enter Proccess Arrival Time ==>> 0 ** Enter Proccess Bust Time ==>> 2 ** Enter Priority of Job ==>> 4 ** Eenter Proccess Number ==>> 3 ** Enter Proccess Arrival Time ==>> 0 ** Enter Proccess Bust Time ==>> 8 ** Enter Priority of Job ==>> 3 ** Eenter Proccess Number ==>> 4 ** Enter Proccess Arrival Time ==>> 0 ** Enter Proccess Bust Time ==>> 6 ** Enter Priority of Job ==>> 1 ************************************************************** * ** Gantt Chart ** -----------------------| p4| p1| p3| p2 -----------------------************************************************************** * Process Arrival Time Bust Time Priority Wating Time 4 1 1 2 3 3 2 4 0 0 0 6 0 11 0 19 2 8 5 6

************************************************************** * ** Avg Turn Around Time ** ** Avrage Turn Arround Time ==>> 14.250000 ************************************************************** *

ASSIGNMENT

NO :-7

#include #include void main() { int n,d,tot,ch,i,sum=0,q[10],f[20],s[20]; clrscr(); printf("\n**************************************************** ******\n"); printf("\n ** Enter The Total Number of Disk Block ==>> "); scanf("%d",&n); printf("\n ** Enter Request String ==>> "); for(i=0;i 98 65 67 183 37 122 14 124

** Enter The Current Head Position ==>> 53 ** Enter The Head Direction ** 0 = Lower ** 1 = Upper ==>> 0 ************************************************************** ***** ** By Using FCFS Disk Scheduling Algorithm ** ** String is ** 53 124 45 98 65 85 183 67 37 146 85 122 14 108 110

59 2 ************************************************************** ***** ** Total Head Position ==>> 640 ************************************************************** *****

ASSIGNMENT

NO :-8

#include #include #include int job[10],i,n,head,cnt[10]; void array_sort() { int i,j,k,temp; for(i=0;i=0;i--) printf("%d\t",job[i]); printf("%d\t",min); for(i=index;i> 9 ** Enter The Request String ==>> 160 90 58 55 18 38 39 150 184 ** Enter Initial Head Position ==>> 100 ** Enter The Range(Min...Max) ==>> 0 200 ** Enter The Direction Of Head ==>> ** 1:Lower... ** 2:Upper... ** Enter The Choice ==>> 2 150 39 160 38 184 18 200 90 58 55

** 200 - 100 = 100 ** 200 - 18 = 182 ** Total Head Movement ==>> 282

ASSIGNMENT

NO :-9

#include #include main() { int f[3]={-1,-1,-1},cnt[3]={-1,-1,1},i,no,a[50],pf=0,ref[20],k=0; clrscr(); printf("\n ** Enter The No of Pages ==>> "); scanf("%d",&no); printf("\n ** Enter The Pages ==>> "); for(i=0;i> 12 *****************************************************

ASSIGNMENT

NO :-10

#include #include main() { int f[3]={-1,-1,-1},cnt[3]={-1,-1,1},pfault=0,i,j,no,a[50]; clrscr(); printf("\n++++++++++++++++++ Least Recen

Popular Tags: