2
1

completion time added

This commit is contained in:
Tanmay 2024-07-27 11:46:42 +05:30
parent bb8c9edb9f
commit 824a7ef5fd

View File

@ -2,7 +2,7 @@
using namespace std;
struct sjf{
int burst, arrival, id;
int burst, arrival, id, completion;
bool active;
};
sjf meh[30];
@ -48,6 +48,7 @@ public:
meh[iddd].burst--;
k++;
if(meh[iddd].burst == 0){
meh[iddd].completion = k;
completed++;
}
} else{
@ -55,11 +56,20 @@ public:
}
}
}
void completion()
{
cout<<"\n\n | Completion time\n";
for(int j = 0; j < n; j++) {
cout<<"P"<<j<<"| "<<meh[j].completion<<"\n";
}
}
};
int main(){
lesgo obj;
obj.sjfIn();
obj.sjfProcess();
obj.completion();
return 0;
}