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; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.