public class Grid { public static void main(String[] args) { // ---------------------------------------------------- // TODO: Check for at least two command line arguments. // If not provided, print a usage statement and return. // ---------------------------------------------------- // ---------------------------------------------------- // TODO: Parse command line arguments into two integers. // These will represent rows and columns. // ---------------------------------------------------- // ---------------------------------------------------- // TODO: Declare and create a rectangular 2D int array. // ---------------------------------------------------- int[][] grid; // ---------------------------------------------------- // TODO: Fill the rectangular grid with random integers. // ---------------------------------------------------- // ---------------------------------------------------- // TODO: Create a non-rectangular (jagged) 2D array. // Each row should have a different length. // ---------------------------------------------------- int[][] grid2; // ---------------------------------------------------- // TODO: Fill the non-rectangular grid with random ints. // ---------------------------------------------------- // ---------------------------------------------------- // TODO: Print both grids using a helper method. // ---------------------------------------------------- // ---------------------------------------------------- // Provided equality demo setup (DO NOT MODIFY) // ---------------------------------------------------- int[][] arr1 = new int[2][2]; int[][] arr2 = new int[2][2]; int[][] arr3; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { arr1[i][j] = i + j; arr2[i][j] = i + j; } } arr3 = arr1; // ---------------------------------------------------- // TODO: Print results of == comparisons. // ---------------------------------------------------- // ---------------------------------------------------- // TODO: Test your gridEquals method. // ---------------------------------------------------- // ---------------------------------------------------- // TODO (Optional): Transpose the rectangular grid and // print the result. // ---------------------------------------------------- } // -------------------------------------------------------- // TODO: // Write a method that prints a 2D array using nested loops. // -------------------------------------------------------- public static void printGrid(int[][] arr) { } // -------------------------------------------------------- // TODO: // Return true if two 2D arrays contain identical values. // -------------------------------------------------------- public static boolean gridEquals(int[][] arr1, int[][] arr2) { return false; } // -------------------------------------------------------- // TODO (Optional): // Return the transpose of a rectangular grid. // -------------------------------------------------------- public static int[][] transpose(int[][] arr) { return null; } }