Exercise P4.4 of Page 174:
Write a program that prompts the user for two numbers, then prints
To do so, implement a class
public class Pair
{
/**
Constructs a pair.
@param aFirst the first value of the pair
@param aSecond the second value of the pair
*/
public Pair(double aFirst, double aSecond)
{
...
}
/**
Computes the sum of the valies of this pair.
@return the sum of the first and second values
*/
public double getSum()
{
...
}
...
}
Then implement s class
PairTester that constructs a Pair object,
invokes its methods, and prints the results.