Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago