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

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

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!