Question: Problem #1 (8 marks) Create your own two exception classes as follows: NotNumberException NotPositiveIntegerException. Create a Java application that prompts the user to enter an

Problem #1 (8 marks) Create your own two exception classes as follows: NotNumberException NotPositiveIntegerException. Create a Java application that prompts the user to enter an integer in a try block. If the user enters a non-integer, it should throw a NotNumberException. If the user enters 0 or a negative integer, it should throw a NotPositiveIntegerException. The two subsequent catch blocks should catch the exceptions and generate appropriate messages. At the end of the try-catch blocks, include a finally block that prints a message, You need to enter a positive integer. Then the application should repeat the whole process until the user enters a positive integer. When the user enters a positive integer, print an appropriate message and terminate the application.

please send me the solution in java as soon as possible.last time i posted the same question but the answer was wrong. please send me the correct answer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!