Question: USE JAVA: Project: YES_UpDownNone In this program write a method called upDown that takes three integers as arguments and returns one of these 3 strings:
USE JAVA:
Project: YES_UpDownNone In this program write a method called upDown that takes three integers as arguments and returns one of these 3 strings:
"increasing" if they are in strictly increasing order (note that 3,3,4 - are not strictly increasing),
"decreasing" if they are in strictly decreasing order.
"neither" "none" otherwise. I recommend you use a complex condition to check for this (that is, have a single if statement with one big question).
In the main method do the following:
read three integers
call upDown for those integers, save the result in a variable and then print it.
call upDown(5,1,9) (these exact values) again and print the numbers and the result. See sample run below.
compare the two results and print same (if they were the same, e.g. both increasing) or different (if they were different e.g. one increasing and one none).
Do not hardcode anything else other than the call to upDown(5,1,9) and the printing of 5,1,9,above. Especially, do not hardcode that fact that the result of that method call is none. What that means is if I modify your program and replace upDown(5,1,9) with upDown(10,50,96), the program should print increasing.
---------- Sample run 1:
Enter three integers separated by spaces: 2 0 9
These numbers are in order: none
Numbers 5,1,9, are in the order: none
same
---------- Sample run 2:
Enter three integers separated by spaces: 15 20 90
These numbers are in order: increasing
Numbers 5,1,9, are in the order: none
different
---------- Sample run 3:
Enter three integers separated by spaces: 9 9 9
These numbers are in order: none
Numbers 5,1,9, are in the order: none
same
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
