Question: JAVA Exercise Define a method computeAverage(int [] arr) that specifically calculates the average value of any int array outside the main method, and call this
JAVA Exercise Define a method computeAverage(int [] arr) that specifically calculates the average value of any int array outside the main method, and call this method in the main method to achieve the same effect as before. Activity 2: Search for extreme values in the array Write a program that allows the user to enter 3 numbers, and then find the maximum value and display it. The effect of the program is as follows:
![JAVA Exercise Define a method computeAverage(int [] arr) that specifically calculates the](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3e88cda8c2_81266f3e88c87214.jpg)
The basic structure of the program is shown below, complete with other codes to achieve the above functions.
public class FindNumber { public static void main(String[] args) { Scanner input = new Scanner( System.in ); System.out.println("Enter 3 numbers:"); int[] nums = new int[3]; for (int i = 0; i
// other codes
}
}
Enter 3 numbers: 3. 5. 6. The maximun number is: 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
