Question: Exceptions Provide exception classes for the following: 1 . Length of password is less than 6 characters ( class LengthException ) Message The password must

Exceptions
Provide exception classes for the following:
1. Length of password is less than 6 characters (class LengthException)
Message The password must be at least 6 characters long
2. Password doesnt contain an uppercase alpha character (class NoUpperAlphaException)
Message The password must contain at least one uppercase alphabetic character
3. Password doesnt contain a lowercase alpha character (class NoLowerAlphaException)
Message The password must contain at least one lowercase alphabetic character
4. Password doesnt contain a numeric character (class NoDigitException)
Message The password must contain at least one digit
5. Password doesnt contain a special character (class NoSpecialCharacterException)
Message The password must contain at least one special character
6. Password contains more than 2 of the same character in sequence (class InvalidSequenceException)
Message The password cannot contain more than two of the same character in sequence.
7. Password contains 6 to 9 characters which are otherwise valid (class WeakPasswordException)
Message The password is OK but weak - it contains fewer than 10 characters.
8. For GUI check if Password and re-typed Password are identical (class UnmatchedException)
Message The passwords do not match
Throw this exception from the GUI, not the utility class.
Note: If more than one error is present in a password, use the above order to throw exceptions. For example, if a password is xxyyzzwwaa$, it fails rules 2 and 4 above. Throw a NoUpperAlphaException, not a NoDigitException.

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!