please i was wondering if anyone could help me with my code, i feel its kinda too long and a good program should be as brief as possible... please would be very grateful. appreciated, cheers..
int _tmain(int argc, _TCHAR* argv[])
{
string Username;
string Password;
int terminator = 0, terminate = 0;
char encrypt;
while (terminate < 2)
{
cout << "Enter Username: ";
getline(std::cin, Username);
if (Username == "Raymond")
{
terminate = terminate + 3;
while (terminator < 2) {
cout << "\nEnter Password: ";
encrypt = _getch();
while(encrypt != 13)
{
Password.push_back(encrypt);
cout << '*';
encrypt = _getch();
}
if (Password == "123456")
{
cout <<"\n\n\t\t******************************";
cout << "\n\t\t* *";
cout << "\n\t\t* *";
cout << "\n\t\t* Welcome Raymond * ";
cout << "\n\t\t* *";
cout <<"\n\t\t******************************"<< endl<<endl ;
terminator = terminator + 3;
}
else
{
cout << "\nInvalid password. Please enter valid password." << std::endl;
cout << "\a\n";
terminator = terminator + 1;
}
}
} else {
cout << "Invalid username. Please enter valid username." << std::endl;
cout << "\a\n";
terminate = terminate + 1;
}
}
return 0;
}