88 : Microsoft Word - Lab 14 CS101: Lab #14 Exceptions Part I Write a Java program that repeatedly accepts two integers from the keyboard and prints the quotient to the console. Your code must adhere...


Java


88 :<br>Microsoft Word - Lab 14<br>CS101: Lab #14<br>Exceptions Part I<br>Write a Java program that repeatedly accepts two integers from the keyboard and prints the quotient to<br>the console. Your code must adhere to the follow specifications:<br>The user must enter 0 for both the numerator and denominator to exit the program.<br>You must read the input values using the Scanner's next () method and then convert to a<br>primitive integer using Integer.parseInt. In case of an exception (when converting the<br>string to an integer), the program must (1) print the corresponding stack trace<br>(printStackTrace) and (2) reset the Scanner object.<br>The program must catch division by zero exceptions and print a corresponding message in case<br>one occurs. The error should not be printed if the user intends to exit.<br>

Extracted text: 88 : Microsoft Word - Lab 14 CS101: Lab #14 Exceptions Part I Write a Java program that repeatedly accepts two integers from the keyboard and prints the quotient to the console. Your code must adhere to the follow specifications: The user must enter 0 for both the numerator and denominator to exit the program. You must read the input values using the Scanner's next () method and then convert to a primitive integer using Integer.parseInt. In case of an exception (when converting the string to an integer), the program must (1) print the corresponding stack trace (printStackTrace) and (2) reset the Scanner object. The program must catch division by zero exceptions and print a corresponding message in case one occurs. The error should not be printed if the user intends to exit.

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here