calculating average and variance in c++ : <p>I need help with my code... I have no idea whats wrong or how to fix it. I think it has something with declaring my variables and referencing but I am not entirely sure how to fix the bugs. Please help! </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;cmath&gt;
using namespace std;

double calculate_average(int test_values[], int&amp; size, int&amp; sum, double&amp; average) {
    int i;
    for (i = 0; i &lt; size; i++) {
        sum += test_values[i];
    };
    return average = sum / i;
    };

double var(int test_values[], int size, double average, double&amp; variance) {

    for (int j = 0; j &lt; size; j++) {
        variance += pow((test_values[j] - average), 2);
    };
    return variance;
};

int main() {

    int test_values[] = { 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, 53 };
    int size = sizeof(test_values);
    int sum;
    double average, variance;

    int calculate_average(int test_values[], int size, int sum, double average);
    int var(int test_values[], int size, double average, double variance);

    cout &lt;&lt; fixed &lt;&lt; showpoint &lt;&lt; setprecision(2);

    cout &lt;&lt; test_values &lt;&lt; endl;
    cout &lt;&lt; average &lt;&lt; endl;
    cout &lt;&lt; variance &lt;&lt; endl;

    return 0;
}
</code></pre>
