Question: public int max(int[] array) 5 points Status: Not Submitted //input method here Write a method that returns the maximum value in an int[] array. For
![public int max(int[] array) 5 points Status: Not Submitted //input method](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f332fa5f837_32966f332f9e898e.jpg)
![here Write a method that returns the maximum value in an int[]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f332faed9fd_33066f332fa909eb.jpg)
![array. For example: max(new int[]{1, 2, 3, 4, 5}) Should return: 5](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f332fb832ee_33166f332fb2d8c6.jpg)

![max(new int[]{}) Should return: public int min(int[] array) 5 points Status: Not](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f332fcac046_33266f332fc471df.jpg)
public int max(int[] array) 5 points Status: Not Submitted //input method here Write a method that returns the maximum value in an int[] array. For example: max(new int[]{1, 2, 3, 4, 5}) Should return: 5 If there are no elements in the array, return O. For example: max(new int[]{}) Should return: public int min(int[] array) 5 points Status: Not Submitted // Implement this method } Write a method that returns the minimum value in an int[] array For example: min(new int[]{1, 2, 3, 4, 5}) Should return: 1 If there are no elements in the array, return O. For example: min(new int[]{}) Should return: 1 public double average(int[] array) 2 - { 3 // Implement this method 4 } 5 points Status: Not Submitted Write a method that returns the average value in an int[] array. For example: average (new int[]{4, 1}) Should return: 2.5 If there are no elements in the array, return O. For example: average(new int[]{}) Should return: 1 public int[] reverse(int[] arr) 2- { 3 // Implement this method 4. } 6 points Status: Not Submitted Write a method that takes an int array and returns a reversed version of the array. For example: reverse(new int[]{1, 2, 3}) Should return an array with the values: [3, 2, 1] 1 public String middleElement(String[] array) 2-{ 3 //input your method here 4 } 3 points Status: Not Submitted Write a method that returns the middle element of a String[] array. If there are an odd number of elements in the array, return the element in the middle of the array. For example: middleElement(new String[]{"hello", "world", "!"}) Should return: "world" If there are an even number of elements in the array, return the second of the two middle elements. For example: middleElement(new String[]{"my", "name", "is", "Karel"}) Should return: "is" If there is are no elements in the array, return the empty String ". For example: middleElement(new String[]{}) Should return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
