String[] list;int[] listStu = new int[100]; System.out.println("| Rank | #Employee | Job Name - Number |"); for (int i = 0; i < list.length - 1; i += 2) { for (n = 1; n < listS.length; n++) { } System.out.println("|\t" + j[n]++ + "\t|\t " + listS[i] + " | " + list[i] + "-" + list[i+1]+"\t|"); }
j[n]++ is the Rank listS[i] is the number of employees for the Job list[i] is the job and list[i + 1] is the job number So basically what I need to do is rank the jobs with the most employees as the highest and the same rank can be given to the jobs with the same number of employees. I tried using another for-loop but it wasn't working how I wanted it to work, sometimes I had the same rank as the #Employees or it would be 0 for the ranks and the employee could go up. Example Rank #Employees Job name - Number 1 3 Engr - 444 2 2 doct - 555 2 2 plom - 777 3 1 trck - 888
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)