Question: Write a class named Process Ints that reads positive integers between 1 and 1000, inclusive, from the keyboard until a user enters 1001 - this

 Write a class named Process Ints that reads positive integers between

Write a class named Process Ints that reads positive integers between 1 and 1000, inclusive, from the keyboard until a user enters 1001 - this is a sentinel-controlled loop. Your program: Prompts the user for each input Validates that the input is within the specified range. If an illegal value is entered, put out an error message and let the user try again. Uses a do..while loop Does not use arrays Detects the sentinel value and outputs a message: "Sentinel entered, exiting." Uses Integer .MAX VALUE and Integer.MIN_VALUE as initial values for your variables that keep track of the smallest and largest values entered by the user. The program should print the following information in the order given below. Provide text in the output that describes what is being shown: a. The sum of all the numbers entered b. The largest number entered (write the code to do this, do not use the Java max() method) c. The smallest number entered (write the code to do this, do not use the Java min() method) d. Whether the sum is odd or even (use the mod operator) Notes: The sentinel value (1001) should not be processed. In other words, 1001 should not be included in the sum and it should not be tested for largest/smallest number entered

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!