Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Answer both using Java, give screenshot as well as \"copy and paste\" code. Than

ID: 3910267 • Letter: A

Question

Answer both using Java, give screenshot as well as "copy and paste" code. Thanks.

t a method named setMajor, It takes a two dimensional square array of integers named a 1.I as a parameter. It initializes all of the elements of the array to the sum of their indices except for the major diagonal (upper left to lower right) where each element is initialized to 9·(For testing use a 5X5 array and have the application print out the array in 2 dimension format. 2. See if you can do the same for the minor diagonal (upper right to lower left) named setMinoir.

Explanation / Answer

public class MatrixDiagonals { static void setMajor(int[][] arr) { for(int i = 0; i