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 methodhere Write a method that returns the maximum value in an int[]array. For example: max(new int[]{1, 2, 3, 4, 5}) Should return: 5If 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!