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...


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?

Nov 17, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here