Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

%3Cp%3EHello%2C%20I%26nbsp%3Bwould%26nbsp%3Bplease%26nbsp%3Blike%26nbsp%3Bto%26n

ID: 3548194 • Letter: #

Question

%3Cp%3EHello%2C%20I%26nbsp%3Bwould%26nbsp%3Bplease%26nbsp%3Blike%26nbsp%3Bto%26nbsp%3Bsee%26nbsp%3Ba%26nbsp%3Bjava%26nbsp%3Bprogram%26nbsp%3Bthat%26nbsp%3Bwill%26nbsp%3B%3Cbr%3E%3Cbr%3Etake%26nbsp%3Bas%26nbsp%3Binput%26nbsp%3Ba%26nbsp%3Bnumber%26nbsp%3Bof%26nbsp%3Bprocesses%2C%26nbsp%3Btheir%26nbsp%3Barrival%26nbsp%3Btime%2C%26nbsp%3Band%26nbsp%3Btheir%26nbsp%3Bburst%26nbsp%3Btime%3Cbr%3E%3Cbr%3Ewith%26nbsp%3Bthose%26nbsp%3Bvalues%2C%26nbsp%3Bit%26nbsp%3Bwill%26nbsp%3Boutput%26nbsp%3Beach%26nbsp%3Bprocess'%26nbsp%3Baverage%26nbsp%3Bwait%26nbsp%3Btime%26nbsp%3Bunder%26nbsp%3Bthe%26nbsp%3Bfirst%26nbsp%3Bcome%26nbsp%3Bfirst%26nbsp%3Bserve%2C%26nbsp%3Bshortest%26nbsp%3Bjob%26nbsp%3Bfirst%26nbsp%3Bnon%26nbsp%3Bpreemptive%2C%26nbsp%3Band%26nbsp%3Bround%26nbsp%3Brobin%26nbsp%3Bscheduling%26nbsp%3Balgorithms.%26nbsp%3B%3Cbr%26nbsp%3Bdata-mce-bogus%3D%221%22%3E%3C%2Fp%3E

Explanation / Answer

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace FCFS_Console { class Program { static void Main(string[] args) { //----------------------------------------Reading I/O File-------------------------------------- string s = Environment.CurrentDirectory.ToString(); // returns the directory of the exe file if (File.Exists(s + @"input.txt")) //checking if the input files exists Console.WriteLine("File Exists"); else { Console.WriteLine("File Not Found"); Console.WriteLine("_________________________________________________________________"); return; } Console.WriteLine("_________________________________________________________________"); //----------------------------------------Data Into List-------------------------------------- string FileText = File.ReadAllText(s + @"input.txt"); //reading all the text in the input file string[] lines = FileText.Split(' '); //splitting the lines List processes = new List(); for (int i = 1; i