Question: java efine a method printResult ( ) that has two double parameters, and outputs Average: followed by the parameters' average with a precision of

java efine a method printResult() that has two double parameters, and outputs "Average: " followed by the parameters' average with a precision of two digits as follows. End with a newline. printResult() should not return any value.
Ex: If the input is -1.0024.00, then the output is:
Average: 11.50
Note:
The calculation to find the average of two values x and y is (x + y)/2.
System.out.printf("%.2f", myDouble) outputs doubles with a precision of two digits.

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 Finance Questions!