subject

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
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
Jenny wants to look at row 345 and compare it to row 17. what can she do if she wanted to easily adjust to see both at once?
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
Eva has many contacts on the professional networking site she uses which contacts are considered second degree
Answers: 3
question
Computers and Technology, 22.06.2019 15:50
The file sales data.xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel.xlsm to find a nice color of gray.)
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
What season was better from fortnite?
Answers: 2
You know the right answer?
Write a program that reads integers userNum and divNum as input, and output the quotient (userNum di...
Questions
Questions on the website: 13722361