Question: Write a public static method named DiffMinMax3 that will take three arguments of type int and will return a int. When called, and passed three

Write a public static method named DiffMinMax3 that will take three arguments of type int and will return a int. When called, and passed three int values, this method must compute and return the positive difference between the minimum and maximum of the three argument values.

Here are some examples of what the method should return for various sets of argument values:

DiffMinMax3(1, 2, 3)     should return 2 DiffMinMax3(50, 10, 20)  should return 40 DiffMinMax3(1, 1, 1)     should return 0 DiffMinMax3(50, 100, 10) should return 90

You will need to write code to determine the minimum and the maximum argument values passed to the method

Do not use Math.min or Math.max methods1 public class Main { 2 3 4 5 6 7 8


 

1 public class Main { 2 3 4 5 6 7 8 9 10 public static void main (String[] agrs) { // you may write code in this main method to test your required method } // define your required method here below

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