Question: Instructions Debug the ova 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 ova 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 are This method must use an enhanced

Instructions Debug the ova 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 are This method must use an enhanced loop to iterate through arr. 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. U6_L5_Activity Three.java 2 runner_06_L5_Activity_T... 1 - public class U6_L5_Activity-Three! 3. public static double avg(doublecl arr) { int s = 0; for(double n : arr) { 6 n + S; s-s/arr.length; } return s; 4 5- 7 8 9 10 11 12 U6_L5_Activity_Three.java 2- runner_U6_L5_Activity_T... 4 5 1 - import java.util.Scanner; - public class runner_06_L5_Activity-Three 3. public static void main(String[] args) { Scanner scan - new Scanner(System.in); System.out.println("Enter array length: "); 6 int len - scan.nextInt(); double [] nums - new double[len); System.out.println("Enter values:"); 9 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!