int main () { string password; int length; bool Case=false, digit=false; cout<<\
ID: 3617165 • Letter: I
Question
int main ()
{
string password;
int length;
bool Case=false, digit=false;
cout<<"Enter password:";
cin>>password;
length=password.length();
if (length<6)
cout<<"Invalid password.Password must be at least 6 characters."<<endl;
for (int i=0; i<length;i++)
{
if (isupper (password[i]) ||islower (password[i]))
Case = true;
if (isdigit (password[i]))
digit=true;
}
if (!digit)
cout<<"Password shouldcontain at least one digit."<<endl;
if (!Case)
cout<< "Password shouldcontain at least one lower/upper case."<<endl;
system ("pause");
Explanation / Answer
please rate - thanks #include using namespace std; int main () { string password; int length; bool UCase=false,LCase=false, digit=false; coutpassword; length=password.length(); if (lengthRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.