Double Array Range and Sum String

Geoffrey Challen // 2023.8.0

Let's compute a few summary statistics on a dataset. Create a method named summarizeValues that accepts an array of double values. The array will not be null and will not be empty.

Compute the mean and the range of the dataset and return a String in the following format:

Where <mean> and <range> are the mean and range of the dataset computed by your method.

Round the values to 2 decimal points using a method round which accepts a double value. For example, round(3.33542) would return 3.34.

Given the array {1.0, 2.0, 4.0}, your method should return: