- Ensure each of the test cases in the class IntegerArrayUtilsTest successfully passes upon completion of each of the method stubs in the class IntegerArrayUtils.
Integer getSum(Integer[] intArray)
Integer getProduct(Integer[] intArray)
Double getAverage(Integer[] intArray)
- Description
- Given an Integer array,
intArray
, return the sum of all values in the array.
- Given an Integer array,
-
Sample Script
// : Given Integer[] input = { 1, 2, 3, 4, 5}; // : When Integer outcome = IntegerArrayUtils.getSum(input); // : Then System.out.println(outcome);
-
Sample Output
15
- Description
- Given an Integer array,
intArray
, return the product of all values in the array.
- Given an Integer array,
-
Sample Script
// : Given Integer[] input = { 1, 2, 3, 4, 5}; // : When Integer outcome = IntegerArrayUtils.getProduct(input); // : Then System.out.println(outcome);
-
Sample Output
120
- Description
- Given an Integer array,
intArray
, return the sum of all values in the array.
- Given an Integer array,
-
Sample Script
// : Given Integer[] input = { 1, 2, 3, 4, 5}; // : When Integer outcome = IntegerArrayUtils.getAverage(input); // : Then System.out.println(outcome);
-
Sample Output
3.0