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, 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 = -9Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started