Code:
#include<iostream>
#include<unistd.h>
#include<conio.h>
#include<cstdlib>
#include<windows.h>
#include<fstream>
using namespace std;
class travel{
int a;
string name;
string seat;
string email;
string mobile;
int cnic;
int *ptr;
public:
void show_logo()
{
cout<<"\t************************************************************\n";
cout<<"\t************************************************************\n";
cout<<"\t************************************************************\n";
cout<<"\t************************************************************\n";
cout<<"\t\t\t";
Sleep(50);
system("color 1");
cout<<"W";
system("color 2");
Sleep(50);
system("color 3");
cout<<"E";
Sleep(50);
system("color 4");
cout<<"L";
Sleep(50);
system("color 5");
cout<<"C";
Sleep(50);
system("color 6");
cout<<"O";
Sleep(50);
system("color 7");
cout<<"M";
Sleep(50);
system("color 8");
cout<<"E";
Sleep(50);
system("color 1");
cout<<" ";
system("color 2");
Sleep(50);
system("color 3");
cout<<"T";
Sleep(50);
system("color 4");
cout<<"O";
Sleep(50);
system("color 5");
cout<<" ";
Sleep(50);
system("color 6");
cout<<"S";
Sleep(50);
system("color 7");
cout<<"I";
Sleep(50);
system("color 8");
cout<<"A";
Sleep(50);
system("color 1");
cout<<"L";
system("color 2");
Sleep(50);
system("color 3");
cout<<"K";
Sleep(50);
system("color 4");
cout<<"O";
Sleep(50);
system("color 5");
cout<<"T";
Sleep(50);
system("color 6");
cout<<" ";
Sleep(50);
system("color 7");
cout<<"T";
Sleep(50);
system("color 8");
cout<<"R";
Sleep(50);
system("color 1");
cout<<"A";
system("color 2");
Sleep(50);
system("color 3");
cout<<"V";
Sleep(50);
system("color 4");
cout<<"E";
Sleep(50);
system("color 5");
cout<<"L";
Sleep(50);
system("color 6");
cout<<" ";
Sleep(50);
system("color 7");
cout<<"A";
Sleep(50);
system("color 8");
cout<<"G";
Sleep(50);
system("color 1");
cout<<"E";
system("color 2");
Sleep(50);
system("color 3");
cout<<"N";
Sleep(50);
system("color 4");
cout<<"C";
Sleep(50);
system("color 5");
cout<<"Y\n";
Sleep(50);
cout<<"\t************************************************************\n";
cout<<"\t************************************************************\n";
cout<<"\t************************************************************\n";
cout<<"\t************************************************************\n";
system("color 20");
system("color f5");
}
void form()
{
system("cls");
system("color 20");
system("color 2f");
cout<<"\nEnter Name:";
cin>>name;
cout<<"\nEnter CNIC:";
cin>>cnic;
cout<<"\nEnter E-mail:";
cin>>email;
cout<<"\nHow many seat you want?"<<endl;
cin>>seat;
cout<<"\nEnter Mobile Number:";
cin>>mobile;
}
void display()
{
cout<<endl<<"CNIC:"<<cnic;
cout<<endl<<"Name:"<<name;
cout<<endl<<"E-mail:"<<email;
cout<<endl<<"Seats:"<<seat;
cout<<endl<<"Mobile"<<mobile;
getch();
start_pro();
}
void display_form(int x)
{
travel s_1;
system("cls");
system("color 20");
system("color 2f");
int h = 0;
ifstream outfile("soo.dat" , ios :: binary | ios :: app);
while(outfile.read((char*)&s_1 , sizeof(travel)))
{
if(s_1.cnic == x)
{
s_1.display();
h = 1;
}
}
outfile.close();
if(h != 1)
{
cout << "\nData not found\a"<<endl;
display();
getch();
start_pro();
cout<<endl;
}
}
void start_pro()
{
char a;
cout<<"\n\t\t\tPRESS A TO CONTINUE THE SOFTWARE\n";
cin>>a;
cout<<a;
switch(a)
case 'a':
case 'A':
{
system("cls");
system("color 4f");
cout<<"\n\t\tPRESS 1 FOR TRANSPORT RESERVATION \n";
cout<<"\n\t\tPRESS 2 FOR CHECK YOUR FLIGHT BOOKING \n";
int xx;
cin>>xx;
switch(xx)
{
case 1:
check();
break;
case 2:
{
long double searchingNo;
travel s_1;
system("cls");
cout << "\n\t\t*****Search by CNIC*****\nEnter CNIC: ";
cin >> searchingNo;
s_1.display_form(searchingNo);
}
break;
}
}
}
void check()
{
system("cls");
system("color 20");
system("color 2f");
cout<<"\n\t\tPLEASE CHOOSE YOUR CHOICE OF TRANSPORT";
cout<<"\n\t\tPRESS 1 FOR : BY AIR";
cout<<"\n\t\tPRESS 2 FOR : BY TRAIN\n";
int choice;
cin>>choice;
switch(choice)
{
case 1:
air();
break;
case 2:
train();
break;
default:
if((choice<0)&&(choice>2))
{
cout<<"\nPlease Enter Right Command";
getch();
check();
}
}
}//check close
void air()
{
system("cls");
system("color 20");
system("color 8f");
cout<<"\n\t\tPLEASE CHOOSE YOUR FLIGHT RESERAVATION PLAN";
cout<<"\n\t\tPRESS 1 FOR INTERNATIONAL FLIGHTS BOOKING";
cout<<"\n\t\tPRESS 2 FOR DOMESTIC FLIGHT BOOKING\n";
int choice;
cin>>choice;
switch(choice)
{
case 1:
{
system("cls");
system("color 9f");
cout<<"\n\t\tWELCOME TO INTERNATIONAL FLIGHT BOOKING SYSTEM";
cout<<"\n\t\t\tHERE WE BOOKING THE FLIGHTS OF \n1.AMERICA\n2.CANADA\n3.ENGLAND\n4.EUROPE(FRANCE,GERMANY,ITALY,HOLAND,SPAIN,PORTAGAL INCLUDING TURKEY)\n5.SAUDIA ARIABA\n6.SOUTH AFRICA\n7.AUSTRIALA\n8.NEWZELAND\n9.DUBAI\n";
cout<<"\n\t\tPLEASE ENTER YOUR DATA FOR ACCOMADATION\n ";
int z[9]={1,2,3,4,5,6,7,8,9};
int x;
cin>>x;
if(x==z[1]||x==z[2]||x==z[3]||x==z[4]||x==z[5]||x==z[6]||x==z[7]||x==z[8]||x==z[9]||x==z[0])
{
travel s_1;
ofstream outfile("student.dat" , ios :: binary | ios :: app);
s_1.form();
outfile.write((char*)&s_1 , sizeof(s_1));
outfile.close();
// form();
getch();
start_pro();
}
else
{
cout<<"Please Enter The Right Command"<<endl;
getch();
air();
}
break;
}
case 2:
{
system("cls");
system("color 9f");
cout<<"\n\t\tWELCOME TO DOMESTIC FLIGHT BOOKING SYSTEM";
cout<<"\n\t\t HERE WE BOOKING THE FLIGHTS IN \n1.LAHORE\n2.ISLAMABAD\n3.KARACHI\n4.SIALKOT\n5.PESHAWAR\n";
cout<<"\n\t\tPLEASE ENTER YOUR DATA FOR ACCOMADATION\n";
int zz[9]={1,2,3,4,5};
int xx;
cin>>xx;
if(xx==zz[1]||xx==zz[2]||xx==zz[3]||xx==zz[4]||xx==zz[5])
{
travel s_1;
ofstream outfile("student.dat" , ios :: binary | ios :: app);
s_1.form();
outfile.write((char*)&s_1 , sizeof(s_1));
outfile.close();
// form();
getch();
start_pro();
}
else
{
cout<<"Please Enter The Right Command"<<endl;
getch();
air();
}
break;
}
}
}// air close
void train()
{
system("cls");
system("color 3f");
cout<<"\n\t\tWELCOME TO TRAIN TICKET BOOKING SYSTEM";
cout<<"\n\t\tHERE WE DEAL THE TICKET WHOLE OVER THE PAKISTAN";
cout<<"\n\t\tLIST OF CITIES IN WHICH WE CONDUCTIING THE TICKETS";
cout<<"\n0.LAHORE\n1.KARACHI\n2.SIALKOT\n3.PESHAWAR\n4.ISLAMABAD/RAWALPINDI\n5.QUETTA\n6.WAZIRABAD\n7.GUJRAT\n8.SARGODHA\n9.MANDI BAHAUDDIN";
cout<<"\n\t\tPLEASE ENTER YOUR DATA FOR YOUR ACCOMADATION\n";
int zz1[9]={1,2,3,4,5,6,7,8,9};
int xx1;
cin>>xx1;
if(xx1==zz1[1]||xx1==zz1[2]||xx1==zz1[3]||xx1==zz1[4]||xx1==zz1[5]||xx1==zz1[6]||xx1==zz1[7]||xx1==zz1[8]||xx1==zz1[9]||xx1==zz1[0])
{
form();
getch();
start_pro();
}
else
{
cout<<"Please Enter The Right Command"<<endl;
getch();
air();
}
}// train close()
void deletee()
{
}
};
int main()
{
system("color 1a");
travel p;
// p.show_logouser();
system("color 20");
system("color 5f");
string user, pass;
int counter=0;
do{
if (counter>0){
system("cls");
cout<<"\n User Name or Password incorret. Please try again \n";
}
cout<<"\n\t\tUser Name: ";
cin>>user;
cout<<"\n\t\tPassword: ";
cin>>pass;
counter++;
if (counter>2){
cout<<"You have tried wrong passowrds 3 times so software is terminated \n";
system("pause");
exit(0);
}
system("cls");
}
while(user.compare("sheraz")==0 && pass.compare("786")==0);
system("cls");
p.show_logo();
p.start_pro();
system("pause");
}
Output:
0 Comments