daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Jul 21st, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Menu:
  2. // Menu
  3. cout << "*******************************n";
  4. cout << "You wanna:n";
  5. cout << "1. Register?n";
  6. cout << "orn";
  7. cout << "2. Login?n";
  8. cout << "Enter your choice and press enter: ";
  9. cin >> choice;
  10.  
  11. switch (choice)
  12. {
  13.     case 1:
  14.     // Check if person is registered
  15.     if (_nick.size() > 0 ) {
  16.         system("CLS");
  17.         cout << "*******************************nn" << "You are already registered!nn";
  18.         goto Menu;
  19.     }
  20.     // Register
  21.     system("CLS");
  22.     cout << "Please select a username:" << endl;
  23.     cin >> _nick;
  24.     cout << "Please select a password:" << endl;
  25.     cin >> _pass;
  26.     goto Menu;
  27.     system("CLS");
  28.     cout << "*******************************nn" << "Successfuly registered!nn";
  29.  
  30.     case 2:
  31.     // Check if person is registered
  32.     system("CLS");
  33.     if (_nick.size() == 0) {
  34.         system("CLS");
  35.         cout << "*******************************nn" << "You are not registered!nn";
  36.         goto Menu;
  37.     }
  38.     // Login
  39.     cout << "Please enter in your nickname:" << endl;
  40.     cin >> nick;
  41.     if (nick != _nick) {
  42.         system("CLS");
  43.         cout << "*******************************nn" << "Bad nickname!nn";
  44.         goto Menu;
  45.     } else {
  46.     cout << "Please enter in your password:" << endl;
  47.     cin >> pass;
  48.     }
  49.     if (pass != _pass) {
  50.         system("CLS");
  51.         cout << "*******************************nn" << "Bad password!nn";
  52.         goto Menu;
  53.     }
  54.     if ((pass == _pass) && (nick == _nick)) {
  55.     // Logged in
  56.     system ("CLS");
  57.     cout << "Welcome!nn";
  58.     }
  59.  
  60.     default:
  61.         cout << "*******************************nn" << "Something went wrong!nn";
  62.         goto Menu;
  63.         break;
  64. }
  65. system("PAUSE");
  66. return 0;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top