Computer Science homework help JAVA?

Computer Science homework help JAVA?




Read a number from the keyboard and print on the screen whether the number is valley or mountain.

A valley number is one where the digits go down and then up. Example: 765469

A mountain number is a number where the digits go up and then down: 124753

Make sure that you check "border" cases: 12345 is neither valley nor a mountain number.

Also 123212 is neither valley nor mountain.


Update : how do I write a program in java that reads a number from the keyboard and prints on the screen whether the number is valley or mountain?





No Answers Posted Yet.