subject
Engineering, 24.03.2020 05:32 Kate1678

Listed below are snippets from a prgram to perform input validation for
a username and password. The code to input and validate the username is
in a seperate file than the code to input and validate the password.

Partial code from user. cpp:

namespace Authenticate
{
void inputUserName(){

do
{
cout << "Enter your username (8 letters only)" << endl;
cin >> username;
}
while(!isvalid());

}
string getUserName()
{
return username;
}
}

Define the username variable and the isValid() function in the
unnamed namespace so the code will compile. The isValid() function
should return true if username contians exactly eight letters.
Generate an appropriate header file for the code.
Repeat rhe same steps for the file password. cpp, placing the password
variable and the isValid() function in the unnamed namespace:

namespace Athenticate
{
void inputPassword(){

do
{
cout << "Enter your password (at least 8 characters " <<
"and at leat one non-letter)" << endl;
cin >> password;
}
while(!isValid());
}

string getPassword()
{
return password;
}
}
For passwords, isValid() should require the passwrod to have eight or
more letters and at leat one non-letter, Generate an appropriate header
file for this code as well.
At this pont, you should have two functions named isValid(), each in
different namesapcs. Place the following main function in an appopriate
place. The program should comile and run.

int main()
{
intputUserName();
inputPassword();
cout << "Your username is " << getUserName() <<
"and your password is: " <<
getPassword() << endl;
return 0;
}

ansver
Answers: 3

Another question on Engineering

question
Engineering, 03.07.2019 14:10
If the thermal strain developed in polyimide film during deposition is given as 0.0044. assume room temperature is kept at 17.3 c, and thermal coefficient of expansion for the film and the substrate are 54 x 10^-6c^-1 and 3.3 x 10^-6c^-1respectively. calculate the deposition temperature.
Answers: 3
question
Engineering, 03.07.2019 15:10
Two flowing streams of argon gas are adiabatically mixed to form a single flow/stream. one stream is 1.5 kg/s at 400 kpa and 200 c while the second stream is 2kg/s at 500 kpa and 100 ? . it is stated that the exit state of the mixed single flow of argon gas is 150 c and 300 kpa. assuming there is no work output or input during the mixing process, does this process violate either the first or the second law or both? explain and state all your assumptions.
Answers: 1
question
Engineering, 04.07.2019 18:10
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
question
Engineering, 04.07.2019 18:10
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
You know the right answer?
Listed below are snippets from a prgram to perform input validation for
a username and passwor...
Questions
Questions on the website: 13722363