In Java, floating-point divide-by-zero is legal and does not result in an exception (instead, it gives a representation of infinity, negative infinity, or a special not-a-number symbol).
a. Verify the above description by performing some floating-point divisions.
b. Write a static divide method that takes two parameters and returns their quotient. If the divisor is 0.0, throw an ArithmeticException. Is a throws clause needed?
c. Write a main program that calls divide and catches the ArithmeticException. In which method should the catch clause be placed?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here