import java.util.Arrays;
import java.util.Collections;
public class Employee {
public static void main(String[] args) {
int [] [] hours = {
{2, 4, 3, 4, 5, 8, 8},
{7, 3, 4, 3, 3, 4, 4},
{3, 3, 4, 3, 3, 2, 2},
{9, 3, 4, 7, 3, 4, 1},
{3, 5, 4, 3, 6, 3, 8},
{3, 4, 4, 6, 3, 4, 4},
{3, 7, 4, 8, 3, 8, 4},
{6, 3, 5, 9, 2, 7, 9} };
int [][] totalhours = new int[8][7];
// Display the array
for (int row = 0; row < 8; row++)
{
for (int col = 0; col < 7; col++)
System.out.print(hours[row][col] + " ");
System.out.println();
}
// sum rows of the array
int total;
for (int row = 0; row < hours.length; row++) {
total = 0;
for (int col = 0; col < hours[row].length; col++)
total += hours[row][col];
System.out.println(" Total of row " + row +
" is " + total);
totalhours [row][0] = total;
}
// sort the contents of the array in descending order
public void hours() {
int h;
Integer[][] hours = new Integer[] {
new Integer (34),
new Integer (28),
new Integer (20),
new Integer (31),
new Integer (32),
new Integer (28),
new Integer (37),
new Integer (41)
};
Arrays.sort(arrayToSort, Collections.reverseOrder());
for (Integer h : hours) {
System.out.println(h.intValue());
}
}
}
}