![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 03.08.2021 16:50 annsmith66
Write a program that reads integers userNum and divNum as input, and output the quotient (userNum divided by divNum). Use a try block to perform the statements. Use a catch block to catch any ArithmeticException and output an exception message with the getMessage() method. Use another catch block to catch any InputMismatchException and output an exception message with the toString() method.
Note: ArithmeticException is thrown when a division by zero happens. InputMismatchException is thrown when a user enters a value of different data type than what is defined in the program. Do not include code to throw any exception in the program.
Ex: If the input of the program is:
15 3
the output of the program is:
5
Ex: If the input of the program is:
10 0
the output of the program is:
Arithmetic Exception: / by zero
Ex: If the input of the program is:
15.5 5
the output of the program is:
Input Mismatch Exception: java. util. InputMismatchException
![ansver](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 19:30, bstine6678
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 16:30, saintsfan2004
How to do this programming flowchart?
Answers: 3
You know the right answer?
Write a program that reads integers userNum and divNum as input, and output the quotient (userNum di...
Questions in other subjects:
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 06.04.2021 17:20
![Konu](/tpl/images/cats/mat.png)
Mathematics, 06.04.2021 17:20
![Konu](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 06.04.2021 17:20
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)