XXX main(){ XXXXXX XXXX; XXXXXXXX XXX; // XX default XXXX mode = XXX::in mode XXX.XXXX("processes.txt"); vector&XX;Process> XXXXXX; XXXXX (fin) { // Read a Line XXXX File XXXXXXX(XXX, line); XX(line.size() &XX; 0) { string id=""; string t=""; int i=1; XXX(char c : line){ XX(c == ' '){ i=X; continue; } XX(i == X){ id+=c; } if(i == X){ t+=c; } } XXXXXXX p(XXXX(id),XXXX(t)); procList.XXXX(p); XXXXXX.XXXXXXXXX(p); } } // Close the file XXX.close(); //Displaying all XXX XXXXXXXXX for(XXXX i=XXXXXX.XXXXX();i!=record.XXX();i++){ i-&XX;XXXXX(); } //Scheduling while(!XXXXXXXX.empty()){ XXXXXXX p = XXXXXXXX.front(); XXXXXXXX.pop(); p.execute(); } XXXXXX 0; }
/* Sample Output :
XXXXXXX : XXXX XXXXXXXXX XXXX : 15 XXXXXXX : XXXX Remaining Time : 16 Process : XXXX Remaining XXXX : 25 XXXXXXX : XXXX Remaining XXXX : 9 Process XXXX XX : 1256 needs 14 more XX XX execution Process XXXX XX : 3389 XXXXX XX XXXX XX of XXXXXXXXX Process XXXX ID : XXXX needs 24 more ms XX XXXXXXXXX XXXXXXX with ID : 4789 XXXXX X more XX of execution Process with ID : 1256 XXXXX XX more ms of XXXXXXXXX XXXXXXX XXXX ID : XXXX XXXXX XX more XX XX execution Process with ID : XXXX XXXXX 23 XXXX ms XX XXXXXXXXX XXXXXXX with XX : 4789 needs X XXXX ms XX XXXXXXXXX XXXXXXX XXXX XX : 1256 needs 12 XXXX ms of XXXXXXXXX XXXXXXX XXXX XX : XXXX needs 13 more XX of execution Process XXXX ID : XXXX needs 22 more ms of XXXXXXXXX XXXXXXX with ID : XXXX XXXXX X more ms of XXXXXXXXX XXXXXXX with ID : 1256 XXXXX XX XXXX XX XX XXXXXXXXX Process with ID : 3389 needs XX XXXX ms XX XXXXXXXXX Process with XX : 2588 needs XX XXXX ms of execution XXXXXXX with XX : 4789 XXXXX X more XX of XXXXXXXXX Process XXXX ID : 1256 XXXXX 10 XXXX XX of XXXXXXXXX Process with XX : 3389 needs XX XXXX XX XX XXXXXXXXX Process XXXX XX : XXXX XXXXX 20 XXXX XX XX XXXXXXXXX Process XXXX XX : XXXX XXXXX 4 XXXX XX XX XXXXXXXXX XXXXXXX XXXX ID : XXXX XXXXX 9 more ms XX XXXXXXXXX Process XXXX ID : XXXX needs XX XXXX XX XX XXXXXXXXX Process XXXX XX : 2588 needs 19 XXXX XX of execution Process XXXX ID : XXXX XXXXX 3 XXXX XX XX XXXXXXXXX Process with XX : 1256 XXXXX 8 more ms XX XXXXXXXXX Process with XX : 3389 XXXXX 9 XXXX ms XX XXXXXXXXX Process with XX : XXXX needs XX XXXX XX XX XXXXXXXXX Process with XX : XXXX XXXXX 2 XXXX XX of XXXXXXXXX XXXXXXX XXXX XX : 1256 needs X more ms XX XXXXXXXXX Process XXXX XX : 3389 XXXXX 8 more XX of execution Process with XX : 2588 XXXXX XX XXXX ms XX execution Process XXXX XX : XXXX needs X more ms of execution Process with ID : XXXX needs 6 XXXX ms XX XXXXXXXXX Process XXXX ID : 3389 XXXXX X more ms of XXXXXXXXX Process XXXX XX : 2588 needs 16 XXXX ms of execution XXXXXXX with ID : 4789 XXXXX 0 XXXX ms XX execution XXXXXXX with XX : XXXX needs 5 XXXX XX XX XXXXXXXXX Process with XX : 3389 XXXXX X more ms XX execution XXXXXXX with XX : XXXX needs XX XXXX ms of XXXXXXXXX Process with XX : 4789 XX Complete! Process with XX : 1256 XXXXX 4 XXXX XX XX execution XXXXXXX with ID : 3389 XXXXX X more ms of XXXXXXXXX XXXXXXX with XX : XXXX XXXXX XX XXXX XX of execution Process with XX : 1256 XXXXX X more XX of execution Process with XX : XXXX XXXXX X more ms XX XXXXXXXXX XXXXXXX XXXX XX : XXXX XXXXX XX more XX XX execution Process with XX : 1256 needs X more XX XX execution XXXXXXX XXXX XX : XXXX XXXXX X XXXX XX XX execution Process XXXX XX : 2588 needs 12 more XX of XXXXXXXXX XXXXXXX XXXX ID : XXXX needs 1 more XX of execution XXXXXXX XXXX XX : 3389 needs 2 more XX XX execution XXXXXXX with ID : XXXX needs 11 XXXX ms XX XXXXXXXXX Process XXXX ID : 1256 XXXXX 0 more XX of execution Process with XX : XXXX XXXXX X more ms of execution XXXXXXX XXXX ID : XXXX XXXXX 10 more ms of XXXXXXXXX XXXXXXX with ID : XXXX XX XXXXXXXX! Process with XX : XXXX XXXXX 0 more XX of XXXXXXXXX Process with ID : XXXX needs 9 XXXX XX of XXXXXXXXX Process XXXX ID : 3389 XX XXXXXXXX! XXXXXXX with ID : XXXX XXXXX X more ms XX XXXXXXXXX XXXXXXX with XX : 2588 needs X more ms of execution Process with ID : XXXX XXXXX 6 more ms XX XXXXXXXXX XXXXXXX with XX : 2588 needs 5 more ms XX XXXXXXXXX Process XXXX ID : 2588 needs 4 XXXX XX XX XXXXXXXXX XXXXXXX XXXX XX : 2588 needs 3 XXXX ms of execution Process with XX : XXXX needs 2 XXXX XX XX execution Process with XX : 2588 needs X XXXX ms XX execution XXXXXXX XXXX XX : XXXX needs 0 more ms of XXXXXXXXX Process with ID : 2588 is Complete!
*/
----------------------------------------------------------------------------------------------------------------------------------------------------------XXX XXXXXX XXXX file XXXX :-