Okay so I got it to work. can someone please teach me on how to print them in different columns like
job name job size time
content 1 6545 5
content 2 4544 4
. . .
. . .
here's the code I now have
List<int> container = new List<int>();
List<int> usabletime = new List<int>();
List<String> jobtitle = new List<string>();
string[] jobname = { "JB1", "JB2", "JB3", "JB4", "JB5", "JB6", "JB7", "JB8", "JB9", "JB10",
"JB11", "JB12", "JB13", "JB14", "JB15", "JB16", "JB17", "JB18",
"JB19", "JB21", "JB21", "JB22", "JB23", "JB24", "JB25", };
int[] job = { 5760, 4190, 3290, 2030, 2550, 6990, 8940, 740, 3930, 6890, 6580, 3820,
9410, 420, 220, 7540, 3210, 1380, 9850, 3610, 7540, 2710, 8390, 5950,
760 };
int[] time = {5, 4, 8, 2, 2, 6, 8, 10, 7, 6, 5, 8, 9, 10, 10, 7, 3, 1, 9, 3, 7, 2, 8, 5, 10 };
int totality = 0, i = 0;
while (totality <= 50000 && i <= job.Length-1)
{
if (totality + job[i] <= 50000)
{
totality = totality + job[i];
container.Add(job[i]);
usabletime.Add(time[i]);
jobtitle.Add(jobname[i]);
}
i++;
}
Console.WriteLine("Job Sizes");
for (int b = 0; b < container.Count; b++)
{
Console.WriteLine(container[b]);
}
Console.WriteLine("Time");
for (int a = 0; a < container.Count; a++)
{
Console.WriteLine(usabletime[a]);
}
Console.WriteLine("Job Name");
for (int c = 0; c < container.Count; c++)
{
Console.WriteLine(jobtitle[c]);
}
Console.ReadLine();