public String toString ()
{
String result;
if (imaginary == 0)
{
return real + " ";
}
else if (real == 0)
{
return imaginary + "i";
}
else (imaginary < 0);
{
return real + " - " + (-imaginary) + "i";
}
return real + " + " = imaginary + "i";
}
}
I am trying to get my code to work, to add, subtract and divide complex numbers. Everything else is compelling correctly but I have one error.
its telling me that my else (imaginary < 0); is incorrect..telling me that it is not a statement