Task 6 - Exceptions
You will need to run some checks on the validity of data been entered. It is expected that the program will throw an exception in the following circumstances:
• If the warranty of a Battery Equipment item is 0 or less
• If the durability of a Standard Equipment item is 0 or less OR greater than 1
You must have a catch block that catches these exceptions and displays an appropriate error message. (You can use the getMessage method of the Throwable class to achieve this)
You only need to alert the user to there being an error with the entered data. You do not need to manage this in any other way at this point.
Your output should be similar to that outlined under Figure 1- Expected Output below
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.