import java.util.Scanner;
public class RationalDriver
{
public static void main(String [] args)
{
Scanner scan = new Scanner;
int num1;
int num2;
int den1;
int den2;
System.out.println("Please enter the numerator of the first fraction: ");
num1 = scan.nextInt();
System.out.println("Please enter the denominator of the first fraction: ");
den1 = scan.nextInt();
System.out.println("Please enter the numerator of the second fraction: ");
num2 = scan.nextInt();
System.out.println("Please enter the denominator of the second fraction: ");
den2 = scan.nextInt();
Rational rat1 = new Rational (num1 , den1);
Rational rat2 = new Rational (num2 , den2);
Rational ratAdd = rat1.add(rat2);
Rational ratSub = rat1.subtract(rat2);
Rational ratMultiply = rat1.multiply(rat2);
Rational ratDivide = rat1.divide(rat2);
System.out.println("When your two fractions are added, they equal: "ratAdd);
System.out.println("When your two fractions are subtracted, they equal: "ratSub);
System.out.println("When your two fractions are multiplied, they equal: "ratMultiply);
System.out.println("When your two fractions are divided, they equal: "ratDivided);
}
}