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:
Length of password is less than characters class LengthException
Message The password must be at least characters long
Password doesnt contain an uppercase alpha character class NoUpperAlphaException
Message The password must contain at least one uppercase alphabetic character
Password doesnt contain a lowercase alpha character class NoLowerAlphaException
Message The password must contain at least one lowercase alphabetic character
Password doesnt contain a numeric character class NoDigitException
Message The password must contain at least one digit
Password doesnt contain a special character class NoSpecialCharacterException
Message The password must contain at least one special character
Password contains more than of the same character in sequence class InvalidSequenceException
Message The password cannot contain more than two of the same character in sequence.
Password contains to characters which are otherwise valid class WeakPasswordException
Message The password is OK but weak it contains fewer than characters.
For GUI check if Password and retyped 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 and 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
