Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. #include <stdafx.h>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8.     string input;
  9.     string user;
  10.     string pass;
  11.  
  12.     cout<<"Hello, choose a number from below in order to gain access to the forum:\n\n1 - Login\n2 - Registration\n\n";
  13. start:
  14.     cin >> input;
  15.  
  16.     if (input == "login" || input == "registration"|| input == "Login" || input == "Registration" || input == "1" || input == "2"){
  17.         if (input == "1"){
  18.             cout<<"\nYou chose to Login.\nPlease enter your username: ";
  19.             cin >> user;
  20.             if (user == "phillip")
  21.                 cout << "Please enter your password: ";
  22.             else
  23.                 goto valid;
  24.  
  25.             cin >> pass;
  26.             if (pass == "password")
  27.                 cout <<"connecting to database-\n\n";
  28.             else
  29.                 goto valid;
  30.  
  31.             int x;
  32.             for (x=0; x<10000; x++){
  33.  
  34.                 cout << x;
  35.             }
  36.  
  37.             cout <<"\n\nConnected! Enjoy your stay.";
  38.  
  39.  
  40.         }
  41.         else if (input == "2"){
  42.             cout<<"\nYou chose to Register.\n\nSorry we are not accepting new members.\nYou may still choose to login if this was a mistake.";
  43.             goto start;
  44.         }
  45.         else {
  46.             cout<<"You chose " << input <<".\n\n";
  47.         }
  48.     }
  49.     else{
  50. valid:
  51.         cout<<"Sorry, that's not valid.\n\n";
  52.         goto start;
  53.     }
  54.  
  55.  
  56.     cin.ignore();
  57.     cin.get();
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement