Question: Write a program that uses c-strings to check whether a password that a user enters is a valid password, with the following rules. Password rules:

Write a program that uses c-strings to check whether a password that a user enters is a valid password, with the following rules.

Password rules:

The password must be at least 8 characters long.

The password must contain at least:

two alphabetic characters [a-zA-Z]

one numeric character [0-9];

one special character from this set: $ # ? *

The password must not contain spaces.

The password must not begin with a dollar sign [$] or an asterisk [*].

The first 2 characters of the password must not be the same character.

Write a program that asks the user for a password and then verifies that it meets the stated criteria. If it is a valid password, the program should display a message saying the password is valid. If it does not verify, the program should display a message telling the user why the password is invalid. Delegate different tasks to different functions so your code is clear and easy to follow!

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 Databases Questions!