Theprogram'smainfunctionmustcallthefollowingthreefunctionsinthegiven order. No any external variables are used by main.
void get_prices(int *, double []);
double *max_avg_sum(double [], int, double *, double *);
void near_avg(double [], int, double, double *);
2. get_pricesfirstpromptsamessage"Howmanypriceswillyouenter?"and based on this input number, it reads all prices into a double type array, which is defined by the 2nd parameter of this function. The price values could be positive,
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |