Advertisement
Guest User

Untitled

a guest
May 29th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <conio.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.  
  10.     //                      1         2
  11.     const string Usernames[] = {"rdogg", "chris"};
  12.     //                      1              2
  13.     const string Passwords[] = {"toxicwaste", "fagget" };
  14.  
  15.     bool MyLoop = true;
  16.    
  17.     while(MyLoop)
  18.     {
  19.  
  20.         int Userinput;
  21.         string Passinput;
  22.  
  23.         cout << "Please enter your username: ";
  24.         cin >> Userinput;
  25.         cout << endl;
  26.  
  27.         cout << "Please enter your password: ";
  28.         cin >> Passinput;
  29.         cout << endl;
  30.  
  31.         switch(Userinput)
  32.         {
  33.             case 1:
  34.  
  35.                 if (Passinput == Passwords[1])
  36.                 {
  37.                     cout << "Welcome Rdogg";
  38.                     MyLoop = false;
  39.                 }
  40.                 else
  41.                     break;
  42.                 break;
  43.  
  44.             case 2:
  45.  
  46.                 if (Passinput == Passwords[2])
  47.                 {
  48.                     cout << "Welcome Chris";
  49.                     MyLoop = false;
  50.                 }
  51.                 else
  52.                     break;
  53.                 break;
  54.  
  55.             default:
  56.                 cout << "Incorrect Username or Password please try again";
  57.                 cin.get();
  58.         }
  59.         system("CLS");
  60.     }
  61.  
  62.     cin.get();
  63.     cin.get();
  64.     return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement