#include<iostream>
using namespace std;
class Array
{
private:
int data[10];
int max;
int min;
double aver;
public:
Array(int a[10]);
void process();
void print();
};
Array::Array(int a[10])
{
for(int i = 0; i < 10; i++){
data[i] = a[i];
}
}
void Array::process()
{
double sum = 0;
max = data[0];
min = data[0];
for(int i = 0; i < 10; i++){
if(data[i+1] > data[i]){
max = data[i+1];
}
if(data[i+1] < data[i]){
min = data[i+1];
}
sum += data[i];
}
aver = sum / 10 ;
}
void Array::print()
{
cout<<"max value is"<<max<<endl;
cout<<"min value is"<<min<<endl;
cout<<"average value is"<<aver<<endl;
}
void main()
{
int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
Array Array(a);
Array.process();
Array.print();
system("pause");
}