(Solved) : Return Average Elements Input Array Param Return Array Input Array Calculate Average Aver Q44087733 . . .

Is there any bug in the code?
/** * Return the average of elements in the input array. * @param * @return array input array to calculate the average from. the average of all numbers in the array. */ public static double findAvg(int array[]) { // short circuit protects null access null && array.length if (array 0) { return 0; double sum = 0; // sum up numbers in the array and calculate the average for (int i = 0; i < array.length; i++) { sum += array[i]; } = (sum / (array.length)); double average return average; Show transcribed image text /** * Return the average of elements in the input array. * @param * @return array input array to calculate the average from. the average of all numbers in the array. */ public static double findAvg(int array[]) { // short circuit protects null access null && array.length if (array 0) { return 0; double sum = 0; // sum up numbers in the array and calculate the average for (int i = 0; i
Expert Answer
Answer to /** * Return the average of elements in the input array. * @param * @return array input array to calculate the average f…
OR