Alice is trying to monitor how much time she spends studying per week. She going through her logs, and wants to figure out which week she studied the least, her total time spent studying, and her average time spent studying per week. To help Alice work towards this goal, write three functions: min(), total(), and average(). All three functions take two parameters: an array of doubles and the number of elements in the array. Then, they make the following computations:
min() - returns the minimum value in the array
sum() - returns the sum of all the values in the array
average() - returns the average of all the values in the array
You may assume that the array will be non-empty.
Function specifications:
Function 1: Finding the minimum hours studied
Name: min()
Parameters (Your function should accept these parameters IN THIS ORDER):
arr double: The input array containing Alice's study hours per week
arr_size int: The number of elements stored in the array
Return Value: double: The minimum value in the array
Function 2: Computing the total hours studied
Name: sum()
Parameters (Your function should accept these parameters IN THIS ORDER):
arr double: The input array containing Alice's study hours per week
arr_size int: The number of elements stored in the array
Return Value: double: The sum of all the values in the array
Function 3: Computing the median study hours
Name: average()
Parameters (Your function should accept these parameters IN THIS ORDER):
arr double: The input array containing Alice's study hours per week
arr_size int: The number of elements stored in the array
Return Value: double: The average of all the values in the array
Sample run 1:
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.