title: Using refrences to transfer values between functions and calculating average of scores after dropping the lowest score. c++
body: <p>/*
  Description: Write a program that calculates the average of a group of test scores, where the lowest score in the
  group is dropped.
  */</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void getScores(int (&amp;arr)[5], int&amp; SIZE) {
  
      for (int i = 0; i &lt; SIZE; i++) {
  
        cout &lt;&lt; "Enter value for student " &lt;&lt; i+1 &lt;&lt;": ";
        cin &gt;&gt; arr[i];
        while (arr[i] &lt; 0 || arr[i] &gt; 100) {
           cout &lt;&lt; "Enter a number between 0 and 100: ";
           cin &gt;&gt; arr[i];
        }
     }
  }
  int findLowest(int (&amp;arr)[5], int&amp; SIZE){
      int min = arr[0];
      for(int j = 0; j &lt; SIZE; j++){
      if(min &gt; arr[j]){
          min = arr[j]; //This min value is what needs to be removed from the 
                        //array values before finding average value.
  
      }   
      }
  
      return min; //use this min value in calAverage() function.
  }
  void calcAverage(int (&amp;arr)[5], int&amp; SIZE, int min){
      int sum = 0;
      arr[min] = {};
      for (int g = 0; g &lt; SIZE; g++) {
        sum += arr[g];
     }
     cout &lt;&lt; "Average is: "&lt;&lt; sum/SIZE;
     return;
  
  }
  </code></pre>
  
  <p>// I am having problem passing info between functions using refrences.</p>
  
  <pre><code>int main(){
      int SIZE = 5;
      int scores[5] = {0};
  
      getScores(scores, SIZE);
  
      int min = findLowest(scores, SIZE);
      calcAverage(scores, SIZE, min);
      return 0;
  }
  </code></pre>