Monday, 16 November 2009

Round Robin Calculator with C++

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.


or you can download executable program in http://www.ziddu.com/download/7474550/debugrr.exe.rar.html

You can fix this program by completing entering arrival time.

That all folks...

Cheers

2 comments:

  1. nti bisa dikembangkan lagi dg arrival time, sehingga adik kelas tdk kesusahan mencari aplikasi ini.thx

    ReplyDelete
  2. Ya pak zaenal... Kemarin saya sudah mencoba menggunakan struktur data linked list. Tapi masih terkendala pada algoritma penghitungan arrival timenya. Akhirnya saya putuskan untuk menggunakan array, walaupun tidak bisa menghitung arrival time...
    "soalnya lupa-lupa ingat sama C++"

    ReplyDelete