Main.java Complete the diffHiLo method. The method takes in a 2-D integer array and returns the difference between the h
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Main.java Complete the diffHiLo method. The method takes in a 2-D integer array and returns the difference between the h
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!