Advertisement
crookedmouth

Username and Password Test

Mar 14th, 2019
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1.     string username = regUserInput;
  2.     string password = regPassInput;
  3.  
  4.     string userInput;
  5.     string passInput;
  6.  
  7.     cout << endl;
  8.  
  9.     while (userInput != username) {
  10.         cout << "Enter Username: " << endl;
  11.         cin >> userInput;
  12.  
  13.         if (userInput != username) {
  14.             cout << "Wrong Username Try Again!" << endl;
  15.         }
  16.     }
  17.  
  18.     if (userInput == username) {
  19.  
  20.         while (passInput != password) {
  21.             cout << "Enter Password: " << endl;
  22.             cin >> passInput;
  23.  
  24.             if (passInput != password) {
  25.                 cout << "Wrong Password Try Again!" << endl;
  26.             }
  27.  
  28.             if (passInput == password) {
  29.                     cout << "Working!" << endl;
  30.             }
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement