0 оценок0% нашли этот документ полезным (0 голосов)
18 просмотров1 страница
The document describes a function that validates passwords by checking if they meet four conditions: 1) being longer than 10 characters without spaces, 2) containing at least one uppercase and one lowercase letter, 3) containing at least two digits or meeting an alternative special character condition, and 4) containing at least one special character from a given set if the digit condition is not met. The function returns a boolean and is provided examples of valid and invalid passwords to illustrate the conditions.
Исходное описание:
A java program showing all the requirement a good password.
The document describes a function that validates passwords by checking if they meet four conditions: 1) being longer than 10 characters without spaces, 2) containing at least one uppercase and one lowercase letter, 3) containing at least two digits or meeting an alternative special character condition, and 4) containing at least one special character from a given set if the digit condition is not met. The function returns a boolean and is provided examples of valid and invalid passwords to illustrate the conditions.
The document describes a function that validates passwords by checking if they meet four conditions: 1) being longer than 10 characters without spaces, 2) containing at least one uppercase and one lowercase letter, 3) containing at least two digits or meeting an alternative special character condition, and 4) containing at least one special character from a given set if the digit condition is not met. The function returns a boolean and is provided examples of valid and invalid passwords to illustrate the conditions.
Write a function boolean isValidPassword (String password)
A Password is valid if it satisfies following conditions: 1. Length of the password must be more than 10(without counting spaces). 2. Password must contain at least one capital and one small alphabet 3. Password must contain at least 2 digits and if it does not have 2 digits then see next condition. 4. Password must contain at least one special character from the given set{$, @, _, -, ., /} For Ex: Password: CraterZone Info@tech (Valid) Password: CraterZone 2Info3tech (Valid) Password: CraterZone Infotech (Invalid since it does not have any special symbol and does not have 2 digits also) Password: Craterzone@ (Invalid since length of the password is not more than 10)
NOTE: You can use any language to code this function but if you are making any assumptions then please define it properly.