@Test (expected = java.lang.IllegalArgumentException.class) public void getShiftedValue_zero(){ Fraction f = new Fraction(1,0); double value = f.getShiftedValue(1); }
public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } Fraction(int numerator, int denominator); }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } Fraction(int numerator, int denominator); double getValue(); double getShiftedValue(int shift); }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } Fraction(int numerator, int denominator); double getValue(); double getShiftedValue(int shift);  }