public class Divide throws Divideexception, arithmeticexception{ //error throws should be private int in method instead of class
Numerator,denominator;
public Divide (int num, int denom)
{
numerator = num;
denominator = denom;
}
Public String toString ()
{
if (Denominator < 0)
throw new Divideexception ("the denominator can not less t Han Zero ");
Return String.Format ("%s", numerator/denominator);
}
public class Divide {
private int numerator,denominator;
public Divide (int num, int denom)
{
numerator = num;
denominator = denom;
}
Public String ToString throws Divideexception, arithmeticexception ()
/**
* ERROR One: Overwrite (override) ToString method You cannot throw an error because the error is not thrown in object ...
* ERROR Two: The parentheses in ArithmeticException () should be followed by the method (ToString ()) throws ....
* *
{
if (Denominator < 0)
throw new Divideexception ("the denominator can not less than zero");
Return String.Format ("%s", numerator/denominator);
}
public class Divide {
private int numerator,denominator;
public Divide (int num, int denom)
{
numerator = num;
denominator = denom;
}
Public String ostring () throws Divideexception, arithmeticexception
/**
* Fixed error to change ToString to ostring
*
*
/{if (Denominator < 0)
throw new Divideexception ("the denominator can not less than zero"); C15/>return String.Format ("%s", numerator/denominator);
}