Question: Write a program to determine whether or not an entered password is valid. Valid passwords consist of 10 characters, 4 of which must be letters
Write a program to determine whether or not an entered password is valid. Valid passwords consist of 10 characters, 4 of which must be letters and the other 6 digits. The letters and digits can be arranged in any order. Only lowercase letters are allowed for valid passwords.
Hints: use islower, isalpha, isdigit, and strlen.
Sample Run Enter a password consisting of exactly 4 lower case letters and 6 digits: asb12 Invalid password. Please enter a password with exactly 4 lower case letters and 6 digits For example, 1234abcd56 is valid. Please enter again: 123sbdf Invalid password. Please enter a password with exactly 4 lower case letters and 6 digits For example, 1234abcd56 is valid. Please enter again: abcd123456 The number of lower case letters in the password is 4 The number of digits in the password is 6 ============ Enter a password consisting of exactly 4 lower case letters and 6 digits: 123anbd456 The number of lower case letters in the password is 4 The number of digits in the password is 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
