Question: You will write Java todeement to use sentinel value when reading unknown number of input from the You can choose any loop of your choice.

 You will write Java todeement to use sentinel value when reading

You will write Java todeement to use sentinel value when reading unknown number of input from the You can choose any loop of your choice. You can define any variable names, but make sure to have appropriate data types. You can asume that keyboard has been define You may use S.O.P/Pin for print, but everything must be in correct Java Syntax. The Java code segment should do the following: A) Ask the user to input integers (as many integers as they want to enter) and -1 to stop the loop. (5 pts) B) As the user enter each number that is not -1, you will keep track (10 pts) count how many are odd integers and how many are even integers (do not include in the count for negative) running total of all even positive integers (do not count zero as positive) count all entered integers (do not include-1 since1 is sentinel value to stop) C) Print out all counts and running total (B) with appropriate label. (2 pts) BONUS3 points Plan average of even positive integers

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!