Answer to Question #153353 in Java | JSP | JSF for Sebastian

Question #153353

Write a class InvalidCNICException that extends Exception class.

The class should have following details implemented

– A message property. 

– override following method that returns message

  String toString()

– Two constructors

 1. With no parameter

 2. With String parameter

Take user input for CNIC. The CNIC is considered valid if

 1. The length of CNIC is 15(including -)

 2. if the hyphen(-) is present at position 6 and 14.

Generate (throw) InvalidCNICException when an invalid CNIC has been entered by the user. Handle this exception by giving user a responsive message saying "The CNIC you entered is not valid


1
Expert's answer
2020-12-30T16:41:48-0500
Dear Sebastian, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog