Quote:

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);

}

}

The problem I am having is when I try to compile this code, the "Scanner scan = new Scanner;" is highlighted and I'm told that " '(' or '[' is expected." The thing is I don't know where I would be missing that at. Also if there any other problems you can see, please tell me as well.