#include <algorithm>
#include <iostream>
using namespace std;

class Math
{
 private:
    int num1; // one of the private data numbers
    int num2; // another one
	int num3; // the third one
	int num4; // the fourth number
	int num5; //the fifth number
 public:
    Math (int first, int second, int third, int fourth, int fifth); // the class constructor
    int Largest(); // member to return the largest number
    int Smallest();
    float Average();
    int Total();
};

Math::Math (int first, int second, int third, int fourth, int fifth)
{
    num1 = first;       // save the first int
	num2 = second ;     // save the second int
    num3 = third;       // save the third int
    num4 = fourth;
    num5 = fifth;
 return;
}

int Math::Largest ()
{
  return max({num1, num2, num3, num4, num5});
}

int Math::Smallest ()
{
	return min({num1, num2, num3, num4, num5});
}
int Math::Total()
{
	return num1+num2+num3+num4+num5;
}
float Math::Average()
{
	return (num1+num2+num3+num4+num5)/5.0;
}
//
// A test main to show it works

int main ()
{
    // make two objects to hold the numbers using the user defined data type
    // ... The value for num1, num2, and num3 will get "constructed" with Object1
    // and Object2 thanks to our class member function Math
    Math Object1 (10, 20, 30, 11, 15); // The object type is Math, the object is
                                // called Object1
    Math Object2 (5, 10, 6, 9, 8);    // The object type is Math, the object is
                                // called Object2
    // find the largest number in the first object (Object1) and print it out
    // use the cout object to print the information
    int solution;
    float sol2;
    sol2 = Object1.Average();
    cout << "Largest is " << sol2 << endl;
   // now do the same for the second object (Object2)
    solution = Object2.Largest();
    cout << "Largest is " << solution << endl;
// all done, so return
    return 0;
}