Question: JAVA HA1.2: Three Means Write a program (ThreeMeans.java) that prompts the user to enter two positive floating-point numbers and prints their arithmetic mean, geometric mean,

 JAVA HA1.2: Three Means Write a program (ThreeMeans.java) that prompts the

JAVA HA1.2: Three Means Write a program (ThreeMeans.java) that prompts the user to enter two positive floating-point numbers and prints their arithmetic mean, geometric mean, and harmonic mean (see the notes below for how to calculate each of them). When the user enters 4.2 and 2.7, the output of your program should look exactly like the following: Enter two positive floating-point numbers: 4.2 2.7 The arithmetic mean is 3.45 The geometric mean is 3.37. The harmonic mean is 3.29 Notes: ?. Make sure to properly display a floating-point number with two digits on the right of the decimal point. 2. arithmeticMean- (numberl +number2)/2.0; geometricMean -Math.sqrt(numberl * number2); harmonicMean (2.0 numberl * number2) / (numberl +number2); Submit the source code file ThreeMeans.java to the drop box HA1.2

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!