// // Ex // import java.util.Scanner; class TestFraction { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Input nume & deno of the 1st fration? "); // Q1: read two integers from the keybaord n, d int n = input.nextInt(); int d = input.nextInt(); // Q2: Declare a fraction x = n/d? Fraction x = new Fraction(n, d); // Q3: display x? //x.writeOut(); // Q4: Read another fraction to y? System.out.print("Input nume & deno of the 2nd fration? "); // Q1: read two integers from the keybaord n, d n = input.nextInt(); d = input.nextInt(); // Q2: Declare a fraction x = n/d? Fraction y = new Fraction(n, d); // Q5: z = x + y; Fraction z = x.add(y); System.out.print("z = "); z.writeOut(); System.out.println("\n\nDone.\n\n"); } }