Question: Use variables to name, store, and retrieve values Write a method according to given specifications Write a method that takes arguments and returns a value

Use variables to name, store, and retrieve values
Write a method according to given specifications
Write a method that takes arguments and returns a value
Use parameter variables in a method body
Write a return statement
Use math operators to construct an expression
Use an if statement to get the computer to make a decision
Problem Description and Given Info
Write a public static method named minMaxDiff 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:
minMaxDiff(1,2,3) should return 2
minMaxDiff(50,10,20) should return 40
minMaxDiff(1,1,1) should return 0
minMaxDiff(50,100,10) should return 90

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!