Question: Write a static method named middleValue that takes three int arguments, and returns an int. When given three different argument values, the method should return
Write a static method named middleValue that takes three int arguments, and returns an int. When given three different argument values, the method should return the value that is numerically between the other two values. When given three values where two or more argument values are the same, then the function should return that value.
Examples:
middleValue(1, 2, 3) will return 2
middleValue(5, 2, 7) will return 5
middleValue(8, 4, 6) will return 6
middleValue(1, 2, 1) will return 1
middleValue(1, 2, 2) will return 2
middleValue(5, 5, 5) will return 5
*code must define a class called Utility
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
