Question: Write a program, NumberStatistics.java, that reads an unspecified number of integers. The program ends with the input 0. The program determines the average of all

Write a program, NumberStatistics.java, that reads an unspecified number of integers. The program ends with the input 0. The program determines the average of all positive values, the average of all negative values, the average of all the values, the maximum value, and the minimum value. Please do not count the zero at the end.

The following are several sample runs. Your program should be able to deal with when no positive integers are entered and/or when no negative integers are entered. Therefore, if statements are needed, after the loop, to print the averages or messages that no values of positiveegative values are entered.

The output must match the sample output exactly!

Thanks . Java and can't use array lists

Write a program, NumberStatistics.java, that reads an unspecified number of integers. The

Write a program, Number Statistics.java, that reads an unspecified number of integers. The program ends with the input 0. The program determines the average of all positive values, the average of all negative values, the averag of all the values, the maximum value, and the minimum value. Please do not count the zero at the end. The following are several sample runs. Your program should be able to deal with when no positive Integers are entered and/or when no negative Integers are entered. Therefore, If statements are needed, after the loop, to print the averages or messages that no values of positiveegative values are entered. > run NumberStatistics Enter a sequence of integers (the input ends if it is 0): 10 16-59-30 Average of positive values = 6.5 Average of negative values = -4.0 Average of all values = 3.0 max = 10 min = 5 0 > run NumberStatistics Enter a sequence of integers (the input ends if it is 0): There is no positive values entered There is no negative values entered > run NumberStatistics Enter a sequence of integers (the input ends if it is o): 5 10 30 Average of positive values = 6.0 There is no negative values entered Average of all values = 6.0 max = 10 min = 3 > run NumberStatistics Enter a sequence of integers (the input ends if it is 0): -4-9-30 There is no positive values entered Average of negative values = 5.333333333333333 Average of all values = -5.333333333333333 max = -3 min = -9

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!