Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

Define a relational DBMS and explain how it organizes data.

Answered: 1 week ago