Question: My code has for underlined in red and I am not sure why. What am I missing? / / Password Checker Quiz #include #include #include
My code has "for" underlined in red and I am not sure why. What am I missing?
Password Checker Quiz
#include
#include
#include
#include
using namespace std;
bool isValidPasswordconst string& password
if passwordlength
return false;
bool hasUpperCase false;
bool hasLowerCase false;
bool hasDigit false;
bool hasSpecialChar false;
bool hasNoSpace false
for char c : password
if isupperc
hasUpperCase true;
else if islowerc
hasLowerCase true;
else if isdigitc
hasDigit true;
else if isprintc && isalnumc
hasSpecialChar true;
else if isspacec
hasNoSpace true;
return hasUpperCase && hasLowerCase && hasDigit && hasSpecialChar && hasNoSpace;
int main
ifstream inputFilePasswordstxt;
if inputFile.isopen
cout "Error opening file." endl;
return ;
int validCount ;
int invalidCount ;
string password;
while inputFile password
if isValidPasswordpassword
validCount;
else
invalidCount;
cout "Total number of valid passwords are validCount endl;
cout "Total number if invalid passwords are invalidCount endl;
inputFile.close;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
