Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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