Advertisement
Guest User

Untitled

a guest
Jul 7th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. do {
  2.  
  3.     cout << "\t\t------------------\n";
  4.     cout << "\t\tLOGIN CREDENTIALS\n";
  5.     cout << "\t\t------------------\n";
  6.  
  7.     cout << "Enter Username : ";
  8.     cin >> username;
  9.  
  10.     cout << "Enter Password : ";
  11.     cin >> password;
  12.  
  13.     if((username == USERNAME && password == PASSWORD) || (username == USERNAME1 && password == PASSWORD1)
  14.       || (username == USERNAME2 && password == PASSWORD2) || (username == USERNAME3 && password == PASSWORD3)) {
  15.         insert=true;
  16.     } else {
  17.         //cout<<"Incorrect user and password. Try again."<<endl;
  18.         attemps++;
  19.       }
  20.  
  21.   } while(insert == false && attemps < 3);
  22.  
  23.   if (insert == false) {
  24.     cout <<"Failed. Bye"<<endl;
  25.     exit(1);
  26.   }
  27.   else {
  28.     cout<<"\n"<<endl;
  29.     cout<<"\nSuccesful authentication!"<<endl;
  30.     cout<<"\n"<<endl;
  31.   }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement