Rabu, 30 Mei 2012


Round Robin Program This program use to calculating waiting time and turn around time of round robin scheduling. The program can't enter the arrival time. So, all the process have arrival time = 0. This is the source code : #include "stdio.h" #include"iostream.h" #include"alloc.h" main() { char pil = 'Y'; do { int st[10],bt[10],wt[10],tat[10],n,tq; int i,count=0,swt=0,stat=0,temp,sq=0; float awt=0.0,atat=0.0; // clrscr(); printf("Masukkan jumlah proces:"); scanf("%d",&n); printf("Masukkan burst time secara berurutan: \n"); for(i=0;itq) st[i]=st[i]-tq; else if(st[i]>=0) { temp=st[i]; st[i]=0; } sq=sq+temp; tat[i]=sq; } if(n==count) break; } for(i=0;i<<"\n\t\tApakah anda ingin menghitung lagi (Y/N) : "; cin>>pil; }while (pil == 'Y'||pil =='y'); } //this is the end of program. sumber : http://warkop-it.blogspot.com/2009/11/round-robin-calculator-with-c.html

Tidak ada komentar:

Adsense Indonesia