Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help, I need help with the sumDiagonal (expected outcome is on the right) and the spiralPrint(even though it says bonus, I still need it)
Please help, I need help with the sumDiagonal (expected outcome is on the right) and the spiralPrint(even though it says bonus, I still need it) my class is working with java, and please explain if you can
repl.it MatrixMethods learn/teach notifications aldo1 (0) 88 talk my repls student share your program enonce your work after submitting O export to rep Due: Mar 08, 2019 11:59 pm 1back to classroom nstructions from your teacher spiralPrint is bonus) After you write each method, check your results here u(square) is 33 sum(rect) 1s 20 sumRow( square, 2) is 6 sumRow rect,2) is sumCol(square, 2) is 7 susCol(rect,2) is 3 sumcross(square,1,3) is 11 sumCross (rect,1,2) is 7 issquare(square) is true 82-7 83 returns the sum of the values along both diagonals if mat is a square matrix (you must cali nethod isSquare) Do not add the center element twice if nat has an odd number of rows 86(HINT: add each diagonal using a sun variable then subtract the center 87 if nat,length % 2 == 1) return -1 if mat is not a square matrix 90 public static int sunDiagonals(int mat[]) YOUR CODE GOES HERE for (int row; rowmat.ength; row tor(int col ; colStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started