Question: Create a C program to validate a password entered by a user. The programs test that it meets certain criteria to be considered a valid

Create a C program to validate a password entered by a user. The programs test that it meets certain criteria to be considered a valid password.
Program Requirements
1. The program should prompt the user to enter a potential password.
2. The password must be at least 8 characters long with no spaces or tabs.
3. Those 8 characters must include 1 uppercase character, 1 lowercase character, 1 number, and 1 punctuation / special character.
Input Requirements
1. The password will be stored in a character array. (string)
2. The input should be limited to 20 characters.
Output Requirements
1. All output should send to standard output.
2. The output should be descriptive.
Sample Output (User Input Is Bold)
Please enter your password to test!
Enter a string (max length 20): zTeh4t$n
This is a valid password.
Please enter your password to test!
Enter a string (max length 20): zteh4t$
Invalid password!
Must have at least 8 characters.
Must have at least 1 uppercase character.
Please enter your password to test!
Enter a string (max length 20): zTehtn
Invalid password!
Must have at least 1 number.
Must have at least 1 special character.
Please enter your password to test!
Enter a string (max length 20): zT 4t$n
Invalid password!
No spaces allowed!
Please enter your password to test!
Enter a string (max length 20): zTfeeds24t$n345321sleep!!
Password entered is too long!
Additional Instructions
- Implement error handling for invalid inputs. (String is too long.)
- Include comments to explain the purpose of each part of your code.
- Test the program with various valid and invalid values.

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!