Question
need a flowgrorithm for this code: #include #include #include #include void password_read(char password[]); int password_check(char password[]); int main(){ char password[100]; int sum; password_read(password); sum =
need a flowgrorithm for this code:
#include
#include
#include
#include
void password_read(char password[]);
int password_check(char password[]);
int main(){
char password[100];
int sum;
password_read(password);
sum = password_check(password);
if (sum) {
printf("Your password is correct ");
}else {
printf("Your password is lackinging ");
}
system("pause");
return 0;
}
//reads the users input
void password_read(char password[]) {
printf("Enter password: ");
printf("Password need to be Uppercase, Digit and $ symbol: ");
scanf("%s", password);
}
//Password need to be Uppercase, Digit and $ symbol
//Password need to be Uppercase, Digit and $ symbol
int password_check(char password[]) {
int upper = 0;
int digit = 0;
int dollar = 0;
int i;
for (i = 0; i < strlen(password); i++) {
if (isupper(password[i])) {
upper = 1;
}
else if (isdigit(password[i])) {
digit = 1;
}
else if (password[i] == '$') {
dollar = 1;
}
}
return (upper && digit && dollar);
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started