Check04A - F output.println("Enter...

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

View Full Document Right Arrow Icon
import type.lib.Fraction; import java.io.PrintStream; import java.util.Scanner; i public class Check04A { public static void main(String[] args) { PrintStream output = System.out; Scanner input = new Scanner(System.in); 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

Ask a homework question - tutors are online