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

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!