Please complete in a way it can be copied and pasted to c co

Please complete in a way it can be copied and pasted to c++ codeblocks and show that it actually runs

Solution

Here is the code for Password.cpp:

#include <iostream>
namespace Authenticate
{
namespace
{
using namespace std;
string password;
bool isValid()
{
if(password.length() >= 8)
return true;
return false;
}
}

void inputPassword()
{
do
{
cout << \"Enter your password (at least 8 characters \" << \"and at least one non-letter) \" << endl;
cin>>password;
}while (!isValid());
}
string getPassword()
{
return password;
}
};

And the code for User.cpp is:

#include <iostream>
namespace Authenticate
{
namespace
{
using namespace std;
string username;
bool isValid()
{
if(username.length() == 8)
return true;
return false;
}
}

void inputUserName()
{
do
{
cout << \"Enter your username (8 letters only)\" << endl;
cin >> username;
}while (!isValid());
}
string getUserName()
{
return username;
}
};

And the final main() function code is:

#include <iostream>
#include \"User.cpp\"
#include \"Password.cpp\"
using namespace Authenticate;
int main()
{
inputUserName();
inputPassword();
cout<<\"Your username is \"<<getUserName()<<\" and your password is: \"<<getPassword()<<endl;
return 0;
}

Please complete in a way it can be copied and pasted to c++ codeblocks and show that it actually runsSolutionHere is the code for Password.cpp: #include <ios
Please complete in a way it can be copied and pasted to c++ codeblocks and show that it actually runsSolutionHere is the code for Password.cpp: #include <ios

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site