Design a class that contains public methods named Solution
Design a class that contains public methods named add(), subtract(), multiply(), and divide(). Each of the methods accepts to numeric arguments and returns a number that represents the result of the appropriate arithmetic operation. Design a main() method the prompts the user for two numbers and tries each of the methods. Assume that a NumberFormatException is automatically created and thrown when a method's argument is not numeric, and that an ArithmeticException is created and thrown if the user attempts to divide by 0. Display an appropriate message when an exception is caught.
You'll get 1 file (1.1KB)