Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

Identify proper selection and interview techniques.

Answered: 1 week ago