#include <iostream>
#include <ctime>
usingnamespace std;
class FIVE
{
private: int x[7];
public:
FIVE()
{
time_t p;
time(&p);
cout << ctime(&p) << endl;
}
void Read()
{
cout << "Enter 7 integer data: " << endl;
for (int i = 0; i < 7; i++)
{
cin >> x[i];
}
}
void Display()
{
cout << "All data: ";
for (int i = 0; i < 7; i++)
{
cout << x[i] << " ";
}
cout << endl;
}
void FindMaxMin(int &mx, int &mn)
{
for (int i = 0; i < 7; i++)
{
if (x[i] > mx)
{
mx = x[i];
}
if (x[i] < mn)
{
mn = x[i];
}
}
}
int FindTotal()
{
int tots;
for (int i = 0; i < 7; i++)
{
tots += x[i];
}
return tots;
}
~FIVE() //deconstructor
{
}
};
int main()
{
FIVE p;
int max, min, total;
max = 0;
min = 0;
p.Read(); //let user enter data
p.Display(); //show data
p.FindMaxMin(max, min); //find the max and min
total = p.FindTotal();
cout << "The Maximum is: " << max << ", the minimum is: " << min << endl;
cout << "The Total is: " << total << endl;
system("PAUSE");
return 0;
}