I have to get two numbers as user input and then run multiple calculations on them. Everything worked fine when I supplied the parameters myself by creating a new object, but now when trying to use input, I'm not exactly sure how to get the input to the constructor parameters where I need them?

Code:`/**`

* a class that computes multiple values using a pair of numbers

*/

public class Pair

{

private static double firstNum;

private static double secondNum;

/**

* constructor to create a pair of numbers

* @param first is value of first number of pair

* @param second is value of second number of pair

*/

public Pair (double first, double second)

{

firstNum = first;

secondNum = second;

}

/**

* calculates the sum of the pair of numbers

* @return the sum of the two numbers of the pair

*/

public static double getSum()

{

return firstNum + secondNum;

}

/**

* calculates the difference of the pair of numbers

* @return the difference of the two numbers of the pair

*/

public static double getDifference()

{

return firstNum - secondNum;

}

/**

* calculates the product of the pair of numbers

* @return the product of the two numbers of the pair

*/

public static double getProduct()

{

return firstNum * secondNum;

}

/**

* calculates the average of the pair of numbers

* @return the average of the two numbers of the pair

*/

public static double getAverage()

{

return (firstNum + secondNum) /2;

}

/**

* calculates the distance (absolute value of the difference) of the pair of numbers

* @return the distance of the two numbers of the pair

*/

public static double getDistance()

{

return Math.abs(firstNum - secondNum);

}

/**

* calculates the maximum number out of the two numbers

* @return the maximum number out of the pair

*/

public static double getMax()

{

return Math.max(firstNum, secondNum);

}

/**

* calculates the minimum number of the two numbers

* @return the minimum number out of the pair

*/

public static double getMin()

{

return Math.min(firstNum, secondNum);

}

}

I have to create a tester class which is where I place the main method which gets the user input

Code:

import java.util.Scanner;

public class PairTester

{

public static void main (String [] args)

{

Scanner in = new Scanner(System.in) ;

System.out.println("Enter a number: ");

double first = in.nextDouble();

System.out.println("Enter a second number: ");

double second = in.nextDouble();

System.out.println(Pair.getSum()) ;

System.out.println(Pair.getDifference()) ;

System.out.println(Pair.getProduct()) ;

System.out.println(Pair.getDistance());

System.out.println(Pair.getAverage()) ;

System.out.println(Pair.getMax()) ;

System.out.println(Pair.getMin()) ;

}

}