Respuesta :
Answer:
The explanation and solution of this question is given below in explanation section. This program is written in c++ using dev C++. This below program run accurately according to requirement of the given question. While explanation of code is commented in the program.
Explanation:
// Example program
#include <iostream>
#include <string>
using namespace std;
int main()
{
Â
  double number[8];// user enter eight batting average
  double average=0.0;// average of all 8 batting
 Â
  for (int i=0; i<8; i++)// prompt user to enter batting average interactively
  {  Â
    cout<<"Please enter batting average of "<<i<<"\n";
    cin>>number[i];    // store batting average into array
   Â
  }
 Â
  double  max = number[0];// maximum average variable declaration
  for (int i = 0; i < 8; i++)//loop to find max average
  {
    if (max < number[i])
      max = number[i];
  }
double min = number[0];//minimum average variable declaration
  for (int i = 0; i < 8; i++)//loop to find minimum average
  {
    if (min > number[i])
      min = number[i];
  }
  cout << "The maximum batting average is : " << max<<"\n";//display maximum average
  cout << "The minimum batting average is : " << min<<"\n";//display minimum average
 Â
  Â
    for (int i=0; i<8; i++)//loop to calculate the average
  {  Â
   Â
    average=average+number[i];// sum of all averages
   Â
  }
  average=average/8;//average of eight batting averages
  cout<<"The average is "<<average<<"\n";//display the average
 Â
 return o; Â
}