Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class LoginManager
- {
- public:
- string PasswordAttempt1;
- string PasswordAttempt2;
- string PasswordAttempt3;
- string UsernameAttempt;
- LoginManager()
- {
- accessGranted = 0;
- }
- void Login()
- {
- USERNAME:
- cout<<"Please enter your Username and Password"<<endl;
- cout<<"Username: ";
- cin>>UsernameAttempt;
- if (UsernameAttempt==Username1)
- {
- goto Login1;
- }
- if (UsernameAttempt==Username2)
- {
- goto Login2;
- }
- if (UsernameAttempt==Username3)
- {
- goto Login3;
- }
- Login1:
- system ("clear");
- cout<<"Username: johnmichaelnebre"<<endl;
- cout<<"Password: ";
- cin>>PasswordAttempt1;
- if (PasswordAttempt1==Password1)
- {
- system ("clear");
- cout<<"Welcome to LaShoppee Mr.johnmichaelnebre"<<endl;
- goto Successful;
- }
- else
- {
- cout<<"Password does not match, Please try again"<<endl;
- goto Login1;
- }
- Login2:
- system ("clear");
- cout<<"Username: briancaguisa"<<endl;
- cout<<"Password: ";
- cin>>PasswordAttempt2;
- if (PasswordAttempt2==Password2)
- {
- system ("clear");
- cout<<"Welcome to LaShoppee Mr.briancaguisa"<<endl;
- goto Successful;
- }
- else
- {
- cout<<"Password does not match, Please try again"<<endl;
- goto Login2;
- }
- Login3:
- system ("clear");
- cout<<"Username: rosacuevas"<<endl;
- cout<<"Password: ";
- cin>>PasswordAttempt3;
- if (PasswordAttempt3==Password3)
- {
- system ("clear");
- cout<<"Welcome to LaShoppee Ms.rosacuevas"<<endl;
- goto Successful;
- }
- else
- {
- cout<<"Password does not match, Please try again"<<endl;
- goto Login3;
- }
- Successful:
- cout<<"\t\t _________________________________"<<endl;
- cout<<"\t\t| |"<<endl;
- cout<<"\t\t| Welcome to LaShoppee |"<<endl;
- cout<<"\t\t|_________________________________|"<<endl;
- cout<<"\t\t| |"<<endl;
- cout<<"\t\t| 1. Shop Now!! |"<<endl;
- cout<<"\t\t| 2. Whats This? |"<<endl;
- cout<<"\t\t| 3. Exit |"<<endl;
- cout<<"\t\t|_________________________________|"<<endl;
- cout<<"\t\t Enter your choice: ";
- }
- private:
- string Password1 = "1234";
- string Password2 = "5678";
- string Password3 = "9012";
- string Username1 = "johnmichaelnebre";
- string Username2 = "briancaguisa";
- string Username3 = "rosacuevas";
- bool accessGranted;
- };
- int main()
- {
- LoginManager LoginManagerObj;
- LoginManagerObj.Login();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement