I wrote code to test for different requirements for a password. I can get most of the requirements to work except for the lowercase letter requirement it shows up for all passwords even if it has a lowercase letter.
thanks i got it working this is what i used
[code]
while (ch!='\n')
{
if (isalpha(ch))
if (islower(ch))
{
lc++;
}
else
{
upL++;
}
if (isdigit(ch))
{
num++;
}
if (isSpecial (ch))
{
sp++;
}
cout<<ch;
length++;
ch=infile.get();
}
cout<<endl;
if (upL==0)
{
password=false;
cout<<"Missing Uppercase Letter"<<endl;
}
if (num==0)
{
password=false;
cout<<"Missing Number"<<endl;
}
if (sp==0)
{
password=false;
cout<<"Missing Special Character"<<endl;
}
if (lc==0)
{
password=false;
cout<<"Missing Lowercase Letter"<<endl;
}
if (length<6)
{
password=false;
cout<<"Not Enough Characters"<<endl;
}
if (password==true)
{
cout<<"Valid Password"<<endl;
valid++;
}
else
{
invalid++;
}
total++;
ch=infile.get();
}
[\code]