Question: Instructions Debug the avg method code in the U6_L5 Activity Three class, which is intended to return the average of the values in the parameter

 Instructions Debug the avg method code in the U6_L5 Activity Three
class, which is intended to return the average of the values in
the parameter array of doubles arr. This method must use an enhanced

Instructions Debug the avg method code in the U6_L5 Activity Three class, which is intended to return the average of the values in the parameter array of doubles arr. This method must use an enhanced loop to iterate through are Use the runner class to test this method: do not add a main method to your code in the U6_L5_Activity Three.java file or it will not be scored correctly. Files STATUS O NOT SUBMITTED U6_L5_Activity_Three.java my runner_U6_L5_Activity_T... 1 - public class U6_L5_Activity-Three{ 2 3 public static double avg(double[] arr) { 4 int s = 0; 5- for(double n : arr) { 6 n+S; 7 S = s/arr.length; 8 } 9 return s; 10 } 11 12 } 13 Files STATUS O NOT SUBMITTED SAVE U6_L5_Activity_Three.java runner_06_L5_Activity_T... 4 5 6 1 - import java.util.Scanner; 2 - public class runner_U6_L5_Activity-Three 3 - public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter array length: "); int len - scan.nextInt(); 7 doublecl nums = new double[len]; 8 System.out.println("Enter values:"); for(int i - 0; i

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!