Question: Create an Exception for Illegal Appliances Create an Exception called IllegalApplianceException which extends IllegalArgumentException. Put your instantiation of an Appliance in a try block, and

Create an Exception for Illegal Appliances
Create an Exception called IllegalApplianceException which extends IllegalArgumentException. Put
your instantiation of an Appliance in a try block, and catch the IllegalApplianceException which should
be thrown if the serial number is invalid. A valid serial number is R
,
D
,
W followed by 11 capital
letters or digits. Write an isValid method which uses a regular expression to check for validity. If the
serial number is not valid print it to the console.Modify the GUI
Include in your GUI a File menu with the menu items Open and Quit. The Open menu item should allow
the user to choose a file for input (as shown in lecture). As said in lecture, when you go to get the name
of the chosen file, be sure to use the getAbsolutePath method, not the getName method.
You may use any structure you want to store and sort the Appliances (your own linked list, an arraylist,
a Java linkedList, etc.)
Display the sorted appliances in the GUI just as in project 2.Submitting the Project.
You should now have at least the following files to submit for this project:
Project2.java Refrigerator.java
Appliance.java Microwave.java
ApplianceGUI.java Dishwasher.java
IllegalApplianceException.java

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 Programming Questions!