Page 1 of 1

Main.java Complete the diffHiLo method. The method takes in a 2-D integer array and returns the difference between the h

Posted: Sat May 14, 2022 4:53 pm
by answerhappygod
Main Java Complete The Diffhilo Method The Method Takes In A 2 D Integer Array And Returns The Difference Between The H 1
Main Java Complete The Diffhilo Method The Method Takes In A 2 D Integer Array And Returns The Difference Between The H 1 (33.2 KiB) Viewed 73 times
Main.java Complete the diffHiLo method. The method takes in a 2-D integer array and returns the difference between the highest element in the array and the lowest. The result should always be a positive number 4 6 Use the following to find absolute value: Main.java 1 class Main 2 { 3 public static void main(String[] args) { 5 int[][] a = { {-5,-2,-3,7}, 7 {1,-5,-2,2}, 8 {1,-2,3,-4) 9 }; 10 System.out.println(diffHilo(a)); // should print 12 11 } 12 public static int diffHilo(int[][] array) 13 { 14 15 } 16 } Math.abs(-1) ==> 1 Math.abs(6) ==> 6 Math.abs(-5) ==> 5