Question: java Write a program that has a method called findAverage. The method takes an array of integers. The method then calculates the average of the

java java Write a program that has a method called findAverage. The method

Write a program that has a method called findAverage. The method takes an array of integers. The method then calculates the average of the Integers stored in the array and returns the average. The method header is public static double average fint arr) You will test your method in the main method of your program by using a Scanner: First read in an int(N) representing the length of an array. Use the length to create a new integer array Read in Nintegers and save these in the array Then call the method findAverage and pass the array you created and print the average that is returned by the method. Examples: Sample Output (the average) Sample Input (an int, a sequence of integers) Note: the first number is the size of the array (number of inputs). 5 8 10 271 5.6 4 30 20 10 60

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!