Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

Q: Does the company conduct a review of the HR function?

Answered: 1 week ago