Bellow you will find my code. I need to modify it to determine if it is an identity matrix or not. It also needs to show the sum of the diagonal (left to right). I need to output whether it is an identity matrix and what the sum is.

Cheers
public static void main(String[] args) {
 
        // Array declaration
        int[][] array;
        int aSize;
        int row = 0;
        int col = 0;
 
        // Create the scanner object
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the number of rows & columns (they will be "
        + "the same): ");
 
        aSize = input.nextInt();
        array = new int[aSize][aSize];
 
        sArray(array);
        Matrix(array);
        rTotal(array);
    }
    // Method to show the Array
    public static void sArray(int array[][]) {
        Scanner sc = new Scanner(System.in);
 
        for (int row = 0; row < array.length; row++) {
        for (int col = 0; col < array[row].length; col++) {
        System.out.print("Row " + (row + 1) + ", ");
        System.out.printf("Column " + (col + 1) + ": ");
        array[row][col] = sc.nextInt();
            }
        }
    } // End sArray Method
 
 
    public static void Matrix(int array[][]) {
        System.out.print("You Entered the Following Matrix: \n");
 
        for (int row = 0; row < array.length; row++) {
        for (int col = 0; col < array[row].length; col++) {
        System.out.print(array[row][col] + " ");
        }
        System.out.print("\n");
        }
    }// End Matrix method
 
    // Method to calculate the row totals
    public static void rTotal(int array[][]) {
        int rSum = 0;
        for (int row = 0; row < array.length; row++) {
        rSum = 0;
        for (int col = 0; col < array.length; col++) {
        rSum += array[row][col];
        }//System.out.print(rSum);
        System.out.printf("The sum of row %d is: %d\n", (row + 1), rSum);
        }