Check04A - F output.println"Enter z" o Fraction z...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import type.lib.Fraction; import; import java.util.Scanner; i public class Check04A { public static void main(String[] args) { PrintStream output = System.out; Scanner input = new Scanner(; S output.println("For each fraction enter its numerator/" + "denominator, pressing ENTER after each"); output.println("Enter x"); Fraction x = new Fraction(input.nextLong(), input.nextLong()); F output.println("Enter y"); o Fraction y = new Fraction(input.nextLong(), input.nextLong());
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: F output.println("Enter z"); o Fraction z = new Fraction(input.nextLong(), input.nextLong()); F output.println("Enter t"); o Fraction t = new Fraction(input.nextLong(), input.nextLong()); F x.add(y); z.add(t); x.divide(z); x Fraction.isQuoted = false; F output.print("A = " + x.toString() + " = " + x.toProperString()); output.println(" = " + (double) x.getNumerator() / x.getDenominator()); } }...
View Full Document

This note was uploaded on 09/16/2011 for the course CSE CSE 1020 taught by Professor Burton,ma during the Fall '10 term at York University.

Ask a homework question - tutors are online