Define a class named Pair where the data(state) part contains two double-typed
numbers, num1 and num2. The method(behaviour) part contain the following methods:
o getSum() – returns the result of adding num1 with num2
o getdifference() – returns the result of substracting num2 from num1
o getProduct() - returns the multiplication of num1 with num2
o getAverage() – returns the average of num1 & num2
o getMax() - returns the larger of the two numbers
o getMin() – returns the smaller of the two numbers
You also need to define a constructor method as described below:
public Pair(double aFirst, double aSecond) {...}
/*
Constructs a Pair object
parameter aFirst the first value of the pair
parameter aSecond the second value of the pair
/
Then write a program named PairTest that reads in two numbers (from standard
input) constructs a Pair object, invokes all of its methods and prints the results.