You are on page 1of 4

#include <iostream>

#include <string>

using namespace std;

int main()

char a[50];

char c[50];

char d[50];

char b;

int chat;

const string USERNAME = "Admin";

const string PASSWORD = "1234567";

string username, password;

bool user_validated = false;

do

cout << "Enter Username:";

cin >> username;

if (username.length() <= 3)

cout << "Username length must be atleast 4 characters long.\n";

else

{
cout << "Enter password:";

cin >> password;

if (password.length() < 6)

cout << "Password length must be atleast 6 characters long." << endl;

else

if (username == USERNAME && password == PASSWORD)

cout << "Loading.......\n\n\n";

user_validated = true;

do

cout << "Welcome Rich!!!\n\n";

cout << "Online Offline\n";

cout << "3. Anne 1. Diana\n";

cout << "4. Gwen 2. Rita\n\n";

cout <<"Please select chat mate:";

cin>>chat;

if(chat==1)

cout<<"Diana is Offline!\n";

cout<<"Want to chat another?Y/N:";

cin>>b;

}
else if(chat==2)

cout<<"Rita is Offline!\n";

cout<<"Want to chat another?Y/N:";

cin>>b;

else if(chat==3)

cout<<"Anne is Online!\n";

cout<<"Rich:";

cin>>a;

cout<<"\nAnne: I'm Busy\n";

cout<<"Want to chat another? Y/N:";

cin>>b;

else if(chat==4)

cout<<"Gwen is Online!\n";

cout<<"Rich:";

cin>>a;

cout<<"Gwen: Yep\n";

cout<<"Rich:";

cin>>c;

cout<<"I'm Sleepy\n";

cout<<"Want to chat another? Y/N:";

cin>>b;

}
}

while(b=='Y');

else

cout << "Wrong Serial number" << endl;

} while (user_validated == false);

You might also like