C++ Project On Tour and Travel
C++ Project On Tour and Travel
h>
#include<conio.h>
#include<fstream.h>
#include<string.h>
#include<stdio.h>
#include<process.h>
struct customer
{
int billno;
char cname[20];
char address[30];
char contact[15];
int tourno;
long int charges;
char ddate[15];
}c;
fstream f,f2;
void main()
{
clrscr();
int a;
textcolor(CYAN);
gotoxy(1,10);
cputs("#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
#*#*#*#");
gotoxy(1,12);
cputs("*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*");
gotoxy(1,14);
cputs("*****
*****");
gotoxy(1,16);
cputs("
WELCOME
");
gotoxy(1,18);
cputs("*****
*****");
gotoxy(1,20);
cputs("
ST.STEPHEN'S SCHOOL
");
gotoxy(1,22);
cputs("*****
*****");
gotoxy(1,24);
cputs("
*****
TOURS AND TRAVELS
****
*
");
gotoxy(1,26);
cputs("
*****
*****
");
gotoxy(1,28);
cputs("
!!!!!PRESENTED~BY-PRIYANKA AND AISHA!!!!!
");
gotoxy(27,30);
cputs("$$$$$CLASS XII-SCIENCE$$$$$");
gotoxy(10,32);
cputs("
**
GUIDED BY- VANDANA DULANI
**
");
getch();
mainmenu:
clrscr();
gotoxy(12,5);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*";
gotoxy(12,7);
cout<<"%%%%%%%%%%***** Kanishka Tours and Travels *****%%%%%%%%%%%%%%";
gotoxy(12,9);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*";
gotoxy(12,13);
cout<<"
1.)View The Tours Available $$$$$$ PRESS 1";
gotoxy(12,15);
cout<<"
2.)Book A New Tour $$$$$$$$$$$$$$$ PRESS 2";
gotoxy(12,17);
cout<<"
3.)View Booked Tours $$$$$$$$$$$$$ PRESS 3";
gotoxy(12,19);
cout<<"
4.)Cancel An Existing Tour $$$$$$$ PRESS 4";
gotoxy(12,21);
cout<<"
5.)EXIT^^^^^^^^^^^^^^^^^^^^^^^^^^^ PRESS 5";
gotoxy(12,23);
cout<<"
Enter Your Choice=???
";
gotoxy(12,27);
cout<<"
#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@# ";
cin>>a;
switch(a)
{
case 1:
clrscr();
gotoxy(5,5);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*!*";
gotoxy(5,7);
cout<<"%%%%%%%%%%%%%***** Kanishka Tours and Travels *****%%%%%%
%%%%%%%%%%%";
gotoxy(5,9);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*!*";
gotoxy(5,12);
cout<<"TOUR NO. :: PLACE :: NO. OF DAYS :: CHARGES :: DE
PARTURE DATE";
gotoxy(5,14);
cout<<"101
GOA
3
Rs.7,200
1
2-OCT-08";
gotoxy(5,16);
cout<<"102
MASURI
5
Rs.12,900
1
5-OCT-08";
gotoxy(5,18);
cout<<"103
SHIMLA
7
Rs.14,800
1
8-OCT-08";
gotoxy(5,20);
cout<<"104
NAINITAL
7
Rs.18,400
2
1-OCT-08";
gotoxy(5,22);
cout<<"105
PALANKHET
5
Rs.21,600
2
6-OCT-08";
gotoxy(5,24);
cout<<"106
KANYAKUMARI
6
Rs.27,800
1
0-NOV-08";
gotoxy(5,26);
cout<<"107
DEHRADOON
2
Rs.8,000
1
4-NOV-08";
gotoxy(5,28);
cout<<"108
RANIKHET
8
Rs.17,000
1
7-NOV-08";
gotoxy(5,30);
cout<<"109
MUMBAI
Rs.34,000
gotoxy(5,32);
cout<<"110
OOTY
Rs.25,000
2-DEC-08";
5-DEC-08";
getch();
goto mainmenu;
case 2:
clrscr();
gotoxy(7,5);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*";
gotoxy(7,7);
cout<<"%%%%%%%%%%%%%**** Kanishka Tours and TRAVELS ****%%%%%%%%
%%%%%%%%%";
gotoxy(7,9);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*";
int x=1;
f.open("tour.txt",ios::in);
while(f.read((char *)&c,sizeof(c)))
{
x=c.billno;
}
f.close();
f.open("tour.txt",ios::app);
c.billno=x+1;
gotoxy(7,11);
cout<<"\n";
cout<<"
Enter the customer name";
gets(c.cname);
cout<<"\n";
cout<<"
Enter the address";
gets(c.address);
cout<<"\n";
cout<<"
Enter your contact number";
gets(c.contact);
cout<<"\n";
cout<<"
Enter your choice of tour no";
cin>>c.tourno;
if(c.tourno==101)
{
c.charges=7200;
strcpy(c.ddate,"12-OCT-08");
cout<<"\n";
cout<<"
The charges are "<<c.charges;
cout<<"\n\n";
cout<<"
The departure date is "<<c.ddate;
cout<<"\n\n";
cout<<"
Your tour has been booked";
}
else if(c.tourno==102)
{
c.charges=12900;
strcpy(c.ddate,"15-OCT-08");
cout<<"\n";
cout<<"
The charges are "<<c.charges;
cout<<"\n\n";
cout<<"
cout<<"\n\n";
cout<<"
else if(c.tourno==108)
{
c.charges=17000;
strcpy(c.ddate,"17-NOV-08");
cout<<"\n";
cout<<"
The charges are "<<c.charges;
cout<<"\n\n";
cout<<"
The departure date is "<<c.ddate;
cout<<"\n\n";
cout<<"
Your tour has been booked";
}
else if(c.tourno==109)
{
c.charges=34000;
strcpy(c.ddate,"12-DEC-08");
cout<<"\n";
cout<<"
The charges are "<<c.charges;
cout<<"\n\n";
cout<<"
The departure date is "<<c.ddate;
cout<<"\n\n";
cout<<"
Your tour has been booked";
}
else if(c.tourno==110)
{
c.charges=25000;
strcpy(c.ddate,"25-DEC-08");
cout<<"\n";
cout<<"
The charges are "<<c.charges;
cout<<"\n\n";
cout<<"
The departure date is "<<c.ddate;
cout<<"\n\n";
cout<<"
Your tour has been booked";
}
getch();
f.write((char *)&c,sizeof(c));
f.close();
goto mainmenu;
case 3:
clrscr();
gotoxy(7,3);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*!*";
gotoxy(7,5);
cout<<"%%%%%%%%%%%%%**** Kanishka Tours and travels ****%%%%%%%%
%%%%%%%%%%%";
gotoxy(7,7);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*!*";
f.open("tour.txt",ios::in);
f.seekg(0);
gotoxy(7,9);
while(f.read((char *)&c,sizeof(c)))
{
cout<<"\n";
cout<<"\t";
cout<<c.billno;
cout<<"\t";
cout<<c.cname;
cout<<"\t";
cout<<c.address;
cout<<"\t";
cout<<c.contact;
cout<<"\t";
cout<<c.tourno;
cout<<"\t";
cout<<c.charges;
cout<<"\t";
cout<<c.ddate;
cout<<endl;
}
f.close();
getch();
goto mainmenu;
case 4:
clrscr();
gotoxy(7,3);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*";
gotoxy(7,5);
cout<<"%%%%%%%%%%%%%**** Kanishka Tours and Travels ****%%%%%%%%
%%%%%%%%%";
gotoxy(7,7);
cout<<"!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
*!*!*!*!*";
gotoxy(7,9);
cout<<"\n";
cout<<"
Enter the bill no to delete";
cin>>x;
f.open("tour.txt",ios::in);
f.seekg(0);
f2.open("temp.txt",ios::out);
while(!f.eof())
{
f.read((char *)&c,sizeof(c));
if(c.billno!=x)
f2.write((char *)&c,sizeof(c));
}
f.close();
f2.close();
remove("tour.txt");
rename("temp.txt","tour.txt");
cout<<"\n";
cout<<"
The record has been deleted";
getch();
goto mainmenu;
default:
clrscr();
gotoxy(7,5);
cout<<"$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$
%$%$%$%$%$%$";
gotoxy(7,11);
cout<<"###########
############";
gotoxy(7,17);
cout<<"$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$
%$%$%$%$%$%$";
getch();
exit(0);
}
}