2008 - public Fraction times(Fraction other return new...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Fraction { private int numerator, denominator; public Fraction (int n, int d) { } public int getNumerator() { } public int getDenominator() { } public Fraction getInverse() { } public Fraction plus (fraction other) { } public int CompareTo (Fraction other) { } public String toString() { } private void reduce() { } public Fraction minus (Fraction other) { } public Fraction times (Fraction other) { } public Fraction dividedBy (Fraction other) { }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public Fraction times (Fraction other) { return new fraction(numerator* other.numerator, denominator*other.denominator); } publice Fractoin dividedBy (Fraction other) { return this.times(other.getInverse()); } public Fraction minus (Fraction other) { return this.plus (other.getNegative()); } public Fraction getNegative (Fraction other) { return new Fraction (-numerator, denominator); }...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

2008 - public Fraction times(Fraction other return new...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online