|
1 | 1 | A website requires the users to input username and password to register. Write a program to check the validity of password input by users. |
2 | 2 | Following are the criteria for checking the password: |
3 | | -1. At least 1 letter between [a-z] |
4 | | -2. At least 1 number between [0-9] |
5 | | -1. At least 1 letter between [A-Z] |
6 | | -3. At least 1 character from [$#@] |
7 | | -4. Minimum length of transaction password: 6 |
8 | | -5. Maximum length of transaction password: 12 |
9 | | -Your program should accept a sequence of comma separated passwords and will check them according to the above criteria. Passwords that match the criteria are to be printed, each separated by a comma. |
10 | | -Example |
| 3 | + |
| 4 | +1. At least 1 letter between [a-z]. |
| 5 | +2. At least 1 number between [0-9]. |
| 6 | +1. At least 1 letter between [A-Z]. |
| 7 | +3. At least 1 character from [$#@]. |
| 8 | +4. Minimum length of transaction password: 6. |
| 9 | +5. Maximum length of transaction password: 12. |
| 10 | + |
| 11 | + |
| 12 | +Your program should accept a sequence of comma separated passwords and will check them according to the above criteria. Passwords that match the criteria are to be printed, each separated by a comma. |
| 13 | + |
| 14 | +### Example |
| 15 | + |
11 | 16 | If the following passwords are given as input to the program: |
| 17 | + |
| 18 | +``` |
12 | 19 | ABd1234@1,a F1#,2w3E*,2We3345 |
| 20 | +``` |
13 | 21 | Then, the output of the program should be: |
| 22 | +``` |
14 | 23 | ABd1234@1 |
| 24 | +``` |
| 25 | + |
| 26 | +### Hints: |
15 | 27 |
|
16 | | -Hints: |
17 | | -In case of input data being supplied to the question, it should be assumed to be a console input. |
| 28 | +In case of input data being supplied to the question, it should be assumed to be a console input. |
0 commit comments