Академический Документы
Профессиональный Документы
Культура Документы
COMPUTER SCIENCE
LAB PROJECT REPORT
Teacher-in-charge
Examiners
1………………………………………….
2………………………………………….
Principal
Date……………………… Date………………………….
Project Members
1. Aswin Shailajan
2. Athul Satheesh
Acknowledgement
ACKNOWLEDGEMENT
Finally, but not the least, I would like to express my sincere gratitude towards
my family members for all the help they given to me and also towards my friends for
their support in the successful completion of the project.
CONTENTS
1 INTRODUCTION
2 WORKING ENVIRONMENT
3 SYSTEM ANALYSIS
Existing System
Proposed System
4 SYSTEM DESIGN
6 SOURCE CODE
7 CONCLUSION
8 BIBLIOGRAPHY
Introduction
INTRODUCTION
This project “Online Bus Ticket” is done using C++, which is an Object-
Oriented Programming Language.
Today, IT industry is an industry which brings in the working environment for our
society in a convenient and efficient way. IT industry is flourishing and has its scope
in relatively all the fields. We are in an era of change and can do away with all the
obstacles of the current prevailing system. The existing manual system of Bus
booking is very difficult to handle as the various operations like reservation of tickets,
cancellation of tickets and queries generated by the passengers take enough time in
executing. While studying and analysing the working of this system, there were many
problems that occurred. These problems are:
It is more costly.
WORKING ENVIRONMENT
SOFTWARE
Language : C++
HARDWARE
Ram : 4.00 GB
SYSTEM ANALYSIS
SYSTEM ANALYSIS
Existing system
In the existing system, many of the operations are done manually. The system
consists of information related to booking of bus ticket. Traditionally tickets were
sold by hand at a ticket counter. Although payments may still be made in cash.
Manual system consumes lot of time and is quite inefficient. As the operations are
done manually there are chances for clerical errors also.
Proposed system
In the proposed system, we try to overcome all these issues of the existing
system. This system is more users friendly and is easy to handle even for a novice
user. As the code is flexible and effective, it is easy to enhance according to the
customer requirement.
SCREENS,
OUTPUTS
&
CODE
SCREENS, OUTPUTS
Output Screen I
Output Screen II
Output Screen IV
Output Screen V
Output Screen VI
Output screen IX
Output Screen X
CODE
PROGRAMME:
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<fstream.h>
#include<process.h>
#include<dos.h>
class ticket
{
int ch2,tno,gst;
float amt,totamt,dist;
char from[30],to[30],name[20],date[30],time[30],status[20];
public:
ticket()
{
amt=0;
totamt=0;
tno=100;
dist=0;
strcpy(status,"BOOKED");
strcpy(name,"NULL");
strcpy(from,"NULL");
strcpy(to,"NULL");
strcpy(date,"NULL");
strcpy(to,"NULL");
}
void accept();
void disp();
void search();
void del();
void edit();
void name1();
void head();
void book();
void show();
void cancel();
void search1();
void modify();
void end();
}t;
void main()
{
clrscr();
int ch;
char ch1;
t.name1();
t.head();
do
{
cout<<"\n\t\t\t ..........MENU.........."
<<"\n\t\t\t 1.Book Tickets"
<<"\n\t\t\t 2.Display Tickets"
totamt=amt+gst;break;
case 2:
strcpy(time,"20:30");
strcpy(from,"Blr");
strcpy(to,"Knr");
amt=900;
gst=45;
dist=312;
totamt=amt+gst;break;
case 3:
strcpy(time,"19:00");
strcpy(from,"Knr");
strcpy(to,"Tvm");
amt=1100;
dist=489;
gst=45;
totamt=amt+gst;break;
case 4:
strcpy(time,"19:00");
strcpy(from,"Tvm");
strcpy(to,"Knr");
amt=1100;
dist=489;
gst=45;
totamt=amt+gst;break;
case 5:
strcpy(time,"20:20");
strcpy(from,"Ern");
strcpy(to,"Blr");
amt=1000;
dist=539;
gst=45;
totamt=amt+gst;break;
case 6:
strcpy(time,"20:20");
strcpy(from,"Blr");
strcpy(to,"Knr");
amt=1000;
dist=539;
gst=45;
totamt=amt+gst;break;
case 7:
strcpy(time,"21:45");
strcpy(from,"Ern");
strcpy(to,"Tvm");
amt=600;
dist=212;
gst=45;
totamt=amt+gst;break;
case 8:
strcpy(time,"21:45");
strcpy(from,"Tvm");
strcpy(to,"Ern");
amt=600;
Sree Narayana Vidya Mandir Senior Secondary School Page 21
ONLINE BUS TICKET
dist=212;
gst=45;
totamt=amt+gst;break;
case 9:
strcpy(time,"18:00");
strcpy(from,"Blr");
strcpy(to,"Tvm");
amt=1500;
dist=731;
gst=45;
totamt=amt+gst;break;
case 10:
strcpy(time,"18:00");
strcpy(from,"Tvm");
strcpy(to,"Blr");
amt=1500;
dist=731;
gst=45;
totamt=amt+gst;break;
default:cout<<"\n\t\tINVALID!!......";break;
}
ofstream ofile;
ofile.open("ticket.dat",ios::app|ios::binary);
ofile.write((char*)&t,sizeof(t));
ofile.close();
cout<<"\n\t\t\tFile Copied.....";
}
void ticket::disp()
{
clrscr();
t.show();
ifstream ifile;
ifile.open("ticket.dat",ios::in|ios::binary);
cout<<"\nTNo Name Start End Dist[km] Date Time Gst Net Amt
Status";
while(ifile.read((char*)&t,sizeof(t)))
{
cout<<"\n\n"<<tno
<<" "<<name
<<" "<<from
<<" "<<to
<<" "<<dist
<<" "<<date
<<" "<<time
<<" "<<gst
<<" "<<totamt
<<" "<<status;
}
ifile.close();
}
void ticket::search()
{
clrscr();
t.search1();
Sree Narayana Vidya Mandir Senior Secondary School Page 22
ONLINE BUS TICKET
int no,f=0;
cout<<"\n\t\t\tEnter TNo to be searched:";
cin>>no;
ifstream ifile;
ifile.open("ticket.dat",ios::in|ios::binary);
cout<<"\nTNo\tName\tStart\tEnd\tDate \tTime\tPerkm\tAmt\tStatus";
while(ifile.read((char*)&t,sizeof(t)))
{
if(no==tno)
{
cout<<"\n"<<t.tno
<<"\t"<<t.name
<<"\t"<<t.from
<<"\t"<<t.to
<<"\t"<<t.date
<<"\t"<<t.time
<<"\t"<<t.gst
<<"\t"<<t.amt
<<"\t"<<t.status;
f=1;
}
}
if(f==0)
cout<<"\nNo Record...\n";
}
void ticket::del()
{
clrscr();
t.cancel();
int no,f=0;
cout<<"\n\t\t\tEnter number to be deleated:";
cin>>no;
ifstream ifile;
ifile.open("ticket.dat",ios::in|ios::binary);
ofstream ofile;
ofile.open("temp.dat",ios::app||ios::binary);
while(ifile.read((char*)&t,sizeof(t)))
{
if(no!=tno)
{
ofile.write((char*)&t,sizeof(t));
f=1;
}
}
cout<<"\n\t\t\t Ticket Cancelled";
if(f==0)
ifile.close();
ofile.close();
remove("ticket.dat");
rename("temp.dat","ticket.dat");
}
void ticket::edit()
{
clrscr();
Sree Narayana Vidya Mandir Senior Secondary School Page 23
ONLINE BUS TICKET
t.modify();
int no,f=0;
char nwname[30];
cout<<"\n\t\t\tEnter no to be edited:";
cin>>no;
ifstream ifile;
ifile.open("ticket.dat",ios::in|ios::binary);
ofstream ofile;
ofile.open("temp.dat",ios::app|ios::binary);
while(ifile.read((char*)&t,sizeof(t)))
{
if(no!=t.tno)
{
ofile.write((char*)&t,sizeof(t));
f=1;
}
else if(no==tno)
{
t.accept();
f=1;
}
if(f==0)
cout<<"\n\t\t\tRecord not found....\n";
}
ifile.close();
ofile.close();
remove("ticket.dat");
rename("temp.dat","ticket.dat");
}
void ticket::name1()
{
char z[100]="\t .............SPACE TRAVELS............";
clrscr();
gotoxy(15,5);
for(int i=0;i<50;i++)
{
delay(50);
cout<<z[i];
}
cout<<"\n\n";
}
void ticket::head()
{
char h[100]="\n\n\t ............ONLINE BUS TICKETS...............";
gotoxy(15,5);
for(int i=0;i<50;i++)
{
delay(50);
cout<<h[i];
}
cout<<"\n\n";
}
void ticket::book()
{
Sree Narayana Vidya Mandir Senior Secondary School Page 24
ONLINE BUS TICKET
cout<<n[i];
}
cout<<"\n\n";
}
void ticket::end()
{
char e[]="\n\n\n\n\n\n\t\t\t..........THANK YOU..........";
clrscr();
gotoxy(15,5);
for(int i=0;i<30;i++)
{
delay(100);
cout<<e[i];
}
cout<<"\n\n";
}
CONCLUSION
CONCLUSION
BIBLIOGRAPHY
BIBLIOGRAPHY