Question: 6. Write a complete Java program (everything that would go in the java file) that does the following: Reads in a number from the user,

6. Write a complete Java program (everything that would go in the java file) that does the following: Reads in a number from the user, verifies that entered value is between-1000 to 1000 inclusive (if not, loop until user enters a valid value), then determines if the number is odd or even (consider zero as even). Display either Number is EVEN or Number is ODD. Loop until the user enters in -9999 for the number. Reminder that -9999 is the sentinel value, so don't display it as ODD. Program execution will look like the following user input is in red): Enter a number between -1000 to 1000 (-9999 to end): 1001 **Input Error - Must be between -1000 to 1000 Enter a number between -1000 to 1000 (-9999 to end): 1001 **Input Error - Must be between -1000 to 1000 Enter a number between-1000 to 1000 (-9999 to end): 100 Number is EVEN Enter a number between -1000 to 1000 (-9999 to end): 9999 **Input Error - Must be between -1000 to 1000 Enter a number between-1000 to 1000 (-9999 to end): -9999 Program Complete
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
