waittime[1]=0; w=w+ data[1]; t=w; S[1]=0; while(w<tt)> { i=2; while(i<= nPages) { if(S[i]==1 && arrival[i]<=t) { waittime[i]=w; cout<<"WaitTime"<<i<<"="<<waittime[i]; S[i]=0; w=w+data[i]; t=w; i=2; } else i++; } } //calculating average weighting Time for(i=1;i<=nPages;i++) sumWaitTime=sumWaitTime+(waittime[i] - arrival[i]); AverageWaitTime=sumWaitTime/nPages; cout<<"Total Weighting Time="<<sumWaitTime<<""; cout<<"Average Weighting Time="<<AverageWaitTime<<"";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)