Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Password checker You are given a function: int CheckPassword ( char str [ ] , int n ) ; The function accepts string ' str

Password checker
You are given a function:
int CheckPassword(char str[], int n);
The function accepts string 'str' of size 'n' as an argument. Implement the function which returns 1 if given string 'str' is a valid password else 0.'str' is a valid password if it satisfies the below conditions:
-At least 4 characters
-At least one numeric digit
-Atleast one capital letter
-Must not have space or slash (??)
-Starting character must not be a number
Assumption:
The input string will not be empty.
Example
Input
aA1_67
Output
1
Input format
Input is a string given by the user.
Output format
Output can be 1 if the entered string is a valid password or 0 if it is invalid.
Sample testcases
Input 1
aA1_67
Output 1
1
Input 2
A4.
Output 2
0
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions