Question: // C++ program for implementation of RR #include using namespace std; //function to find the waiting time for all //processes void findWaitingTime(int process[],int n, int
// C++ program for implementation of RR
#include
void findWaitingTime(int process[],int n, int bt[], int wt[], int quantum){ //make a copy of burst times bt[] to store remaining //burst time int rem_bt[n]; for (int i=0;i
//function to calculate turn around time void findTurnAroundTime(int process[],int n ,int bt[], int tat,int quantum){ int wt[n], tat[n], total_wt=0, total_tat=0; findWaitingTime(process,n,bt,wt,quantum);//function to find waiting time of all processes findTurnAroundTime(process,n,bt,wt,tat);//function to find turn around time of all processes cou<<"PN\t"<<"\tBT"<<"WT"<<"\tTAT "//display processes along with all details for(int i=0;i){ //calculate total waiting time and total run around time total_wt=total_wt + wt[i]; total_tat=total_tat + tat[i]; cout<<""<
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
