Question: Write a program that reads a set of positive floating point data values. A negative value signals the end of the data set When all

Write a program that reads a set of positive floating point data values. A negative value signals the end of the data set When all of the positive values have been read, your program will print out the count, average, and standard deviation of the positive data values The average of a data set (, s is where , means zi+z3t t The standard deviation is s(n-1) You can compute this quantity by keeping track of the count, the sum and the sum of squares as each data value is processed Write a class Dataset with instance variables count, sum, and sumot squares. That class should have a method public void addValue (double value) to process the input value and update count, sum, and sumof Squares. Write methods getAverage ) and getstandardDeviation ) in the class Dataset. Your main program will create a Dataset object, read in values and call the addValue instance method until it encounters a negative value. Then it will call the getavezage and getstandardDeviation methods and print out the return results Example Run Enter Data: 1 23446 -1 Average 3.2 standard Deviation in 972815247
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
