Question: Write a method called ordered which takes three double values as parameters and returns true if the values are in order - either ascending or
Write a method called ordered which takes three double values as parameters and returns true if the values are in order - either ascending or descending; false otherwise. Note that the values do not need to be sequentially ordered as in 1, 2, 3 they could be 30, 47, 90.
The table below shows sample calls and the value that should be returned.
Method Value Call Returned --------------------------------- ordered(1,2,3) true ordered(87,75,20) true ordered(6,6,4) false ordered(1,9,7) false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
