Free Version
Difficult

# 2-Dimensional Array of Salaries in Reverse Order

APCSA-1PXXET

Select the appropriate segment of code from the choices below to print the salaries of employees per the following requirement:

// Print the salaries of all employees of the company.
// Each row of salaries is a department.
// Each element is a salary of an employee in that dept.
// Print the departments in the order they are listed.
// Print the salaries from each department in reverse order of how they are stored in the array.
public static void printSalariesInReverseOrder(int[][] salaries)
{
// Select one of the options below
}

A
for (int i=0; i<salaries[0].length; i++)
{
for (int j=salaries.length-1; j>=0; j--)
System.out.print(salaries[i][j] + " ");
System.out.println();
}

B
for (int i=0; i<salaries[0].length; i++)
{
for (int j=salaries.length-1; j>=0; j--)
System.out.print(salaries[j][i] + " ");
System.out.println();
}

C
for (int i=0; i<salaries.length; i++)
{
for (int j=0; j<salaries[i].length; j++)
System.out.print(salaries[i][j] + " ");
System.out.println();
}

D
for (int i=salaries.length-1; i<=0; i--)
{
for (int j=0; j<salaries[i].length; j++)
System.out.print(salaries[i][j] + " ");
System.out.println();
}

E
for (int i=0; i<salaries.length; i++)
{
for (int j=salaries[i].length-1; j>=0; j--)
System.out.print(salaries[i][j] + " ");
System.out.println();
}