(solution) 1. Write a JAVA class named Strict that has the method equals as

(solution) 1. Write a JAVA class named Strict that has the method equals as

 1. Write a JAVA class named Strict that has the method equals as specified in the book on page 316 (ALL CORRESPONDING ELEMENTS ARE THE SAME.) 2. The class named Strict should also have a method public static int howmany(int[][] m1, int[][] m2) that returns how many cell values are identical in the two arrays (it only counts if they are identical in the same cell.) 3. The class named Strict should also have a method public static int diagonal(int[][] m1, int[][] m2) that returns how many cell values are identical along the diagonal (that is, checking only cells [0][0], [1][1], and [2][2] from the two arrays.) 4. The class named Strict should also have a method public static double average(int[][] m1,int[][] m2)that returns the average of all the cell values from the arrays (one answer--DIVIDING BY 18.) 5. The class named Strict should also have a method public static void display(int[][] m1, int[][] m2) that displays only those values of the arrays that are odd in rectangular form (row by row for each array.) You may assume the values entered are between 0 and 99 for formatting purposes. Make it pretty! 6. The class named Strict should also have a method public static boolean silly(int[][] m1, int[][] m2) that returns true if the two arrays have all numbers satisfying 1 < numbers <=10 and returns false otherwise. Write a public class named your IdenticalArrays that permits the user to provide sample input like in the textbook and then displays the results of equals, howmany, diagonal , average (2 digits after the decimal point), display, and silly. Skip one line after the answer for each method is printed. DO NOT ASK FOR 18 PROMPTS. ENTER ALL THE NUMBERS AT ONCE AND USE NESTED FOR LOOPS TO PROCESS. Both classes should be in the same file.

316 Chapter 8 Multidimensional Arrays
Write a test program that prompts the user to enter a 3 * 3 matrix of double
values and displays a new column-sorted matrix. Here is a sample run:
Enter a 3-by-3 matrix row by row:
0.15 0.875 0.375
0.55 0.005 0.225
0.30 0.12 0.4
The column-sorted array is
0.15 0.0050 0.225
0.3 0.12
0.375
0.55 0.875 0.4 8.28 (Strictly identical arrays) The two-dimensional arrays m1 and m2 are strictly
identical if their corresponding elements are equal. Write a method that returns
true if m1 and m2 are strictly identical, using the following header:
public static boolean equals(int m1, int m2) Write a test program that prompts the user to enter two 3 * 3 arrays of
integers and displays whether the two are strictly identical. Here are the
sample runs.
Enter list1: 51 22 25 6 1 4 24 54 6
Enter list2: 51 22 25 6 1 4 24 54 6
The two arrays are strictly identical Enter list1: 51 25 22 6 1 4 24 54 6
Enter list2: 51 22 25 6 1 4 24 54 6
The two arrays are not strictly identical 8.29 (Identical arrays) The two-dimensional arrays m1 and m2 are identical if they
have the same contents. Write a method that returns true if m1 and m2 are identical, using the following header:
public static boolean equals(int m1, int m2) Write a test program that prompts the user to enter two 3 * 3 arrays of integers
and displays whether the two are identical. Here are the sample runs.
Enter list1: 51 25 22 6 1 4 24 54 6
Enter list2: 51 22 25 6 1 4 24 54 6
The two arrays are identical Enter list1: 51 5 22 6 1 4 24 54 6
Enter list2: 51 22 25 6 1 4 24 54 6
The two arrays are not identical