Question Details

(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

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 13, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now