Write a program where the user enters numbers (doubles) on standard input. All of these numbers should be greater than zero, except for the last one, which should be -1. The -1 is a sentinel value and is how the user signals that he or she is done entering numbers.
Your program should read in all of these numbers, and print out one of three things after the user enters -1:
If the numbers are in ascending order (each number is greater than the previous one), then print "Ascending."
If the numbers are in descending order (each number is less than the previous one), then print "Descending."
If the numbers are neither ascending or descending, then print "No Order."
Ignore the final -1 in all three cases. Do print the period.
Your program must print its output after reading the -1, even though it may be able to determine that the input is in "No Order" after only a few numbers have been read.
You may assume that you always get legal input. You always get at least two numbers greater than zero, and the last number is always -1.
I am having problems with this for my cs102 class. Could anyone help?