#include "statistic.h"
#include <iostream>
usingnamespace std;
void Statistic::printStatistics(int x)
{
int max = x;
int min = x;
int numberOfVariables = 0;
int i;
longint sum = x;
longint average = sum / numberOfVariables;
if(x, x!= 0, x--)
{
cout << "Please enter other variable" << endl;
cin >> i;
numberOfVariables++;
sum += i;
if( max > i )
max = i;
if( min < i)
min = i;
cout << "The sum of the values that was entered are: " << sum << endl;
cout << endl;
cout << "The average of the values that was entered are: " << average << endl;
cout << endl;
cout << "The largest of the values that was entered is: " << max << endl;
cout << endl;
cout << "The smallest of the values that was entered is: " << min << endl;
};
};
statistic.h
1 2 3 4 5 6 7
class Statistic
{
public:
void printStatistics(int);
};