Question: Hello, Stuck on this problem currently. Java (Netbeans IDE) In this project, define a customer class similar to what you defined for project 5 and
Hello,
Stuck on this problem currently.
Java (Netbeans IDE)
In this project, define a customer class similar to what you defined for project 5 and 6. A Customer has a first name, last name, and social security number. Define the Customer constructor so it will initialized those attributes. Define an exception class called "InvalidCustomerException". Update the Customer constructor to throw an exception when an invalid Social Security Number is passed to the constructor. Update the main method with a try/catch block to catch the exception and call the getMessage() method in the catch block.
InvalidCustomerException class should override the getMessage() method to return a string such as Invalid SSN 5438-98-9876.
I created the InvalidCustomerException class and stated the attributes plus the constructor. Now I am stuck at updating the Customer exception in the customer class in the second half of the problem. Any help would be appreciated.
Thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
