Answered You can hire a professional tutor to get the answer.

QUESTION

I need help in writing a java class. The class contains:A specific constructor with an

I need help in writing a java class. The class contains:

A specific constructor with an

appropriate ArrayList parameter that copies the data from the parameter to the data object within the class itself.

A GetResult method that returns an ArrayList of integers (note the lower case I) that are the bins of the histogram. The value ranges of the bins are set via other methods below. A RuntimeException is thrown if the histogram is not valid for any reason. Note that a histogram can be valid for zero data elements, but is invalid if the MinRange is greater than the MaxRange value below.

A method named "SetNumberBins" that sets the number of equal size bins in the histogram. If this method is not called then the default value is 10.  A method named "GetNumberBins" that returns the current number of bins set. Note that the min and max range values set below are type dependent. Be sure use the correct generic type.  A method named "SetMinRange" sets the lowest value at which data is included in the lowest bin. Data that is less than this value is not placed in any bin if GetResult is called. The default is negative infinity.

A method named "GetMinRange" that returns the current MinRange value.

A method named "SetMaxRange" sets the highest value at which data is included in the highest bin. Data that is greater or equal than this value is not placed in any bin if GetResult is called. The default is positive infinity. If a data value falls exactly on the dividing line between two bins, it is placed in the higher value bin. For example, if the data is type integer and two bins range from 0 to 3 and 3 to 6, then a data value of 3 would be placed in the 3 to 6 range bin. 

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question