BUS TRANSPORT MANAGEMENT
#include <iostream>
#include <conio.h>
#include <fstream>
#include <string.h>
using namespace std;
class login
{
public:
char
id[10];
char
pass[10];
char
*passward;
void
getid()
{
cout<<"Enter
your id:"<<endl;
cin>>id;
cout<<"Enter
the password:"<<endl;
cin>>pass;
}
void
show()
{
cout<<"ID:"<<id<<endl;
cout<<"Password:"<<pass<<endl;
}
};
class detail
{
public:
int
busno;
char
bname;
char
destination[10];
void
getin()
{
cout<<"Enter
the bus no:"<<endl;
cin>>busno;
cout<<"Enter
the bus name:"<<endl;
cin>>bname;
cout<<"Enter
the destination point:"<<endl;
cin>>destination;
}
void
show()
{
cout<<busno<<endl;
cout<<bname<<endl;
cout<<destination<<endl;
}
};
class reserve
{
public:
int
busno;
char
bname;
char
dest[10];
char
pname[10][100];
int
age[10];
int
nosr;
int
i;
int
d,m,y;
int
conc;
float
amount;
void getin()
{
cout<<"Enter
the bus no:"<<endl;
cin>>busno;
cout<<"Enter
the bus name:"<<endl;
cin>>bname;
cout<<"Enter
the destination point:"<<endl;
cin>>dest;
cout<<"Enter
the no of seats required:"<<endl;
cin>>nosr;
for(i=0;i<nosr;i++)
{
cout<<"Passenger
name:"<<endl;
cin>>pname[i];
cout<<"Passenger
age:"<<endl;
cin>>age[i];
}
cout<<"The
date of travel:"<<endl;
cin>>d>>m>>y;
cout<<"Enter
the concession category:"<<endl;
cout<<"1.Military
person:"<<endl;
cout<<"2.senior
citizen:"<<endl;
cout<<"3.children
under 5 years:"<<endl;
cout<<"4.None:"<<endl;
cin>>conc;
cout<<"...............END
OF GETTING DETAIL..............."<<endl;
}
void show()
{
cout<<"Bus
no:"<<busno<<endl;
cout<<"Bus
name:"<<bname<<endl;
cout<<"Destination
point:"<<dest<<endl;
cout<<"Passenger
name:"<<pname<<endl;
cout<<"Passenger
age:"<<age<<endl;
cout<<"No
of seats required:"<<nosr<<endl;
for(i=0;i<nosr;i++)
{
cout<<"Passenger
name:"<<pname[i];
cout<<"Passenger
age:"<<age[i];
}
cout<<"Date
of
reservation:"<<d<<"_"<<m<<"_"<<y;
cout<<"Concession
categary:"<<conc<<endl;
cout<<"You
must pay your amount:"<<amount<<endl;
cout<<"*********************************************"<<endl;
cout<<"...................END
OF RESERVATION..................."<<endl;
cout<<"*********************************************"<<endl;
}
};
class cancellation
{
public:
int
busno;
char
bname;
char
dest[10];
char
pname[10][100];
int
age[10];
int
nosr;
int
i;
int
d,m,y;
int
conc;
float
amount;
void
getin()
{
cout<<"Enter
the bus no:"<<endl;
cin>>busno;
cout<<"Enter
the bus name:"<<endl;
cin>>bname;
cout<<"Enter
the destination point:"<<endl;
cin>>dest;
cout<<"Enter
the no of seats required:"<<endl;
cin>>nosr;
for(i=0;i<nosr;i++)
{
cout<<"Passenger
name:"<<endl;
cin>>pname[i];
cout<<"Passenger
age:"<<endl;
cin>>age[i];
}
cout<<"The
date of cancellation:"<<endl;
cin>>d>>m>>y;
cout<<"Enter
the concession category:"<<endl;
cout<<"1.Military
person:"<<endl;
cout<<"2.senior
citizen:"<<endl;
cout<<"3.children
under 5 years:"<<endl;
cout<<"4.None:"<<endl;
cin>>conc;
cout<<"...............END
OF GETTING DETAIL..............."<<endl;
}
void
show()
{
cout<<"Bus
no:"<<busno<<endl;
cout<<"Bus
name:"<<bname<<endl;
cout<<"Destination
point:"<<dest<<endl;
cout<<"Passenger
name:"<<pname<<endl;
cout<<"Passenger
age:"<<age<<endl;
cout<<"No
of seats cancelled:"<<nosr<<endl;
for(i=0;i<nosr;i++)
{
cout<<"Passenger
name:"<<pname[i];
cout<<"Passenger
age:"<<age[i];
}
cout<<"Date
of
cancellation:"<<d<<"_"<<m<<"_"<<y;
cout<<"Concession
categary:"<<conc<<endl;
cout<<"You
must pay your amount:"<<amount<<endl;
cout<<"*********************************************"<<endl;
cout<<"...................END
OF Cancellation..................."<<endl;
cout<<"*********************************************"<<endl;
}
};
void user();
void exit();
void database();
int main()
{
int ch;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"............WELCOME
TO NIAZI EXPRESS............"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
do
{
cout<<"^^^^^^^^^^^^^^^^^^^^^MAIN
MENU^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<"1.Admin
mode:"<<endl;
cout<<"2.User
mode:"<<endl;
cout<<"3.exit:"<<endl;
cout<<"enter
your choice"<<endl;
cin>>ch;
switch(ch)
{
case
1:
database();
break;
case
2:
user();
break;
case
3:
exit();
}
}
while
(ch<=3);
getch();
}
void database()
{
char
*password;
detail
a;
fstream
f;
int ch;
char c;
cout<<"Enter
the password correcttly:"<<endl;
}
0 Comments