Statistical functions focus on calculating statistics from the data, such as min, max, sum, and average.
min, sum, average, count_divisible_5, sum_divisible_5.
List.cpp, Test_List.cpp
. Please use these 2 files for coding. List.cpp
file has already implemented all the requirements from HW3, including all the basic functions of a List.
Please refer to HW3 for more details.
int min ()
: Find and return the minimum value from the list. If the list is empty, return error code (-1).int sum()
: Calculate and return the sum of all values from the list.float average()
: Calculate and return the average value from the list. If the list is empty, return 0.int count_divisible_5()
: counts how many numbers in the list are divisible by 5.int sum_divisible_5()
: calulate and return the sum of all numbers in the list are divisible by 5.