Hey I have this tough assignment that just keeps on getting harder and harder. I have 3 more functions to complete.

Function1:

I have to print the positions of the three consecutive values that have the largest average. If more than 3 consecutive values have the same average, print the positions with the lowest subscripts. I have to print the positions (subscripts), not the actual values.

Here's my code so far-

Code:

```
void printConsecutive(int array[], int number)
{
int largeAvg;
largeAvg = (array[0] + array[1] + array[2]);
for (int i = 3; i < number; i = i + 3){
if ( (array[i] + array[i++] + array[i = i + 2]) > largeAvg){
int j = i++;
int k = i + 2;
cout<< i << ", " << j << ", " << k << endl;}
}
```

Its not giving me the results I want.

Then I have to do this-

Function 2:

determine the percentage of the numbers from 1 to 100 that appear in the array. For example, if the array holds 100 integers and all the integers are unique (all numbers from 1 to 100 appear), the percentage would be 100%. The expected percentage is lower as duplicates may appear. To do this, each value from 1 to 100 is searched for in the array (using the search function) and if the number appears, a counter is incremented. Then the percentage is calculated. The result will be a value from 0.01 to 1.00. Note: if the user has asked for 10 values, then the maximum coverage in this case would be .1. This would mean that ten unique values between 1 and 100 are contained in the array. If, for example, the user asked for 50 values, then the max coverage would be 50% (.5), meaning than the array contained 50 values between 1 and 100 with no duplicates. If there were two duplicates, this would make the coverage only 48% (.48).

Function 3:

using the linear search function, search for the key in the array and return the position if found or -1 if not found

This function will only be needed (and used) by the coverage function (above).

Here's my code so far for function 3 ( I dont know how to implement it in function 2)-

Code:

```
int search (int list [], int size, int key)
{
int pos = 0;
while (pos < size && list[pos] != key)
pos++;
if (pos == size)
pos = -1;
return pos;
}
```

Any advice would be appreciated, and thanks in advance.