Вы находитесь на странице: 1из 30

ONLINE BUS TICKET

SREE NARAYANA VIDYA MANDIR


SENIOR SECONDARY SCHOOL
Talap, Kannur-670 002.

COMPUTER SCIENCE
LAB PROJECT REPORT

Certified that this project is the bonafide project report of

Mr/Ms.……………………..………..Of standard XII B with

Register Number………………………for the year 2019-2020.

Teacher-in-charge

Valued at the board examination

Examiners

1………………………………………….

2………………………………………….
Principal

Date……………………… Date………………………….

Sree Narayana Vidya Mandir Senior Secondary School Page 1


ONLINE BUS TICKET

ONLINE BUS TICKET

Sree Narayana Vidya Mandir Senior Secondary School Page 2


ONLINE BUS TICKET

Sree Narayana Vidya Mandir Senior Secondary School Page 3


ONLINE BUS TICKET

Project Members
1. Aswin Shailajan

2. Athul Satheesh

Sree Narayana Vidya Mandir Senior Secondary School Page 4


ONLINE BUS TICKET

Acknowledgement

Sree Narayana Vidya Mandir Senior Secondary School Page 5


ONLINE BUS TICKET

ACKNOWLEDGEMENT

I would like to express my sincere gratitude and thanks towards Mrs.Deepika


Jaidas, the Principal of Sree Narayana Vidya Mandir, for the guidance and
encouragement throughout my course and at the time of my project.

I am extremely grateful to Ms Thushara, Teacher, Department of Computer


Science for her sincere and timely help and corporation during all the phases of my
project.

Special mentions have to be made of Ms.Vipina, Ms.Linju and Ms


Vineetha, Teachers, Department of Computer Science for all her support and help
rendered towards the fulfillment of the project.

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.

Sree Narayana Vidya Mandir Senior Secondary School Page 6


ONLINE BUS TICKET

CONTENTS

1 INTRODUCTION

2 WORKING ENVIRONMENT

3 SYSTEM ANALYSIS

 Existing System
 Proposed System

4 SYSTEM DESIGN

5 SCREENS & OUTPUTS

6 SOURCE CODE

7 CONCLUSION

8 BIBLIOGRAPHY

Sree Narayana Vidya Mandir Senior Secondary School Page 7


ONLINE BUS TICKET

Introduction

Sree Narayana Vidya Mandir Senior Secondary School Page 8


ONLINE BUS TICKET

INTRODUCTION

This project “Online Bus Ticket” is done using C++, which is an Object-
Oriented Programming Language.

Object Oriented Programming Language enables you to model more closely


whatever real world problem the program is being written to solve. In addition,
because objects are discrete entities, you can debug, modify and maintain them more
easily.

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:

Manual system is a time-consuming method, i.e manual system takes a large


amount of time for processing queries generated by the passengers.

There is a possibility of duplicity of data in manual system. Due to this, there


is also a possibility of inconsistency.

Manual system is difficult to operate.

It is more costly.

It uses more man power.

Sree Narayana Vidya Mandir Senior Secondary School Page 9


ONLINE BUS TICKET

WORKING ENVIRONMENT

SOFTWARE

Platform : Microsoft Windows10

Language : C++

HARDWARE

Processor : Intel® Pentium ® CPU


G4560 @3.50 GHz

Clock speed : 333 Mhz

Ram : 4.00 GB

Hard disk capacity : 160 GB

Bit specification : 64 Bits

Keyboard : lenovo keys

Mouse : lenovo Optical

Display device : lenovo TFT

Sree Narayana Vidya Mandir Senior Secondary School Page 10


ONLINE BUS TICKET

SYSTEM ANALYSIS

Sree Narayana Vidya Mandir Senior Secondary School Page 11


ONLINE BUS TICKET

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.

Drawbacks of Existing System

 Difficulty in maintaining records


 Difficulty in searching for records
 Huge space consumption.

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.

Sree Narayana Vidya Mandir Senior Secondary School Page 12


ONLINE BUS TICKET

SCREENS,

OUTPUTS

&
CODE

Sree Narayana Vidya Mandir Senior Secondary School Page 13


ONLINE BUS TICKET

SCREENS, OUTPUTS
Output Screen I

Output Screen II

Output Screen III

Sree Narayana Vidya Mandir Senior Secondary School Page 14


ONLINE BUS TICKET

Output Screen IV

Output Screen V

Output Screen VI

Sree Narayana Vidya Mandir Senior Secondary School Page 15


ONLINE BUS TICKET

Output Screen VII

Output Screen VIII

Output screen IX

Sree Narayana Vidya Mandir Senior Secondary School Page 16


ONLINE BUS TICKET

Output Screen X

Sree Narayana Vidya Mandir Senior Secondary School Page 17


ONLINE BUS TICKET

CODE

Sree Narayana Vidya Mandir Senior Secondary School Page 18


ONLINE BUS TICKET

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"

Sree Narayana Vidya Mandir Senior Secondary School Page 19


ONLINE BUS TICKET

<<"\n\t\t\t 3.Search Tickets"


<<"\n\t\t\t 4.Cancel tickets"
<<"\n\t\t\t 5.Modify tickets"
<<"\n\t\t\t 6.Exit"
<<"\n\t\t\t Your choice [1-6]:";
cin>>ch;
switch(ch)
{
case 1:t.accept();break;
case 2:t.disp();break;
case 3:t.search();break;
case 4:t.del();break;
case 5:t.edit();break;
case 6:t.end();exit(0);
default:cout<<"\nInvalid\n";break;
}
cout<<"\n\n\n\t\tDo You Wany To Continue[Y/y]:";
cin>>ch1;
}
while((ch1=='Y')||(ch1=='y'));
if((ch1!='y')||(ch1!='y'))
exit(0);
getch();
}
void ticket::accept()
{
t.book();
++tno;
cout<<"\n\t\t\tName Of The Pasenger:";
gets(name);
cout<<"\n\t\t\tEnter Date:";
gets(date);
cout<<"\n\t\t\tchoose your travel places:"
<<"\n\t\t\t1.Knr --> Blr"
<<"\n\t\t\t2.Blr --> Knr"
<<"\n\t\t\t3.Knr --> Tvm"
<<"\n\t\t\t4.Tvm --> Knr"
<<"\n\t\t\t5.Ern --> Blr"
<<"\n\t\t\t6.Blr --> Ern"
<<"\n\t\t\t7.Ern --> Tvm"
<<"\n\t\t\t8.Tvm --> Ern"
<<"\n\t\t\t9.Blr --> Tvm"
<<"\n\t\t\t10.Tvm -->Blr"
<<"\n\t\t\tEnter your choice [1-10]:";
cin>>ch2;
switch(ch2)
{
case 1:
strcpy(time,"20:30");
strcpy(from,"Knr");
strcpy(to,"Blr");
amt=900;
gst=45;
dist=312;
Sree Narayana Vidya Mandir Senior Secondary School Page 20
ONLINE BUS TICKET

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

char j[100]="\t ..........BOOK TICKETS..........";


clrscr();
gotoxy(15,5);
for(int i=0;i<50;i++)
{
delay(50);
cout<<j[i];
}
cout<<"\n\n";
}
void ticket::show()
{
char k[100]="\t ..........DISPLAY TICKETS..........";
clrscr();
gotoxy(15,5);
for(int i=0;i<50;i++)
{
delay(50);
cout<<k[i];
}
cout<<"\n\n";
}
void ticket::cancel()
{
char l[100]="\t ..........CANCEL TICKETS..........";
clrscr();
gotoxy(15,5);
for(int i=0;i<50;i++)
{
delay(50);
cout<<l[i];
}
cout<<"\n\n";
}
void ticket::search1()
{
char m[100]="\t ..........SEARCH TICKETS..........";
clrscr();
gotoxy(15,5);
for(int i=0;i<50;i++)
{
delay(50);
cout<<m[i];
}
cout<<"\n\n";
}
void ticket::modify()
{
char n[100]="\t ..........MODIFY TICKETS..........";
clrscr();
gotoxy(15,5);
for(int i=0;i<50;i++)
{
delay(50);
Sree Narayana Vidya Mandir Senior Secondary School Page 25
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";
}

Sree Narayana Vidya Mandir Senior Secondary School Page 26


ONLINE BUS TICKET

CONCLUSION

Sree Narayana Vidya Mandir Senior Secondary School Page 27


ONLINE BUS TICKET

CONCLUSION

To conclude in total the computerized billing of Bus Ticket


network system is widely accepted due to its menu driven feature,
reliability and user-friendly options like:

Modifiability: Since we have followed the file method for


Writing the source, the program can be modified without much
overhead.

User friendly: The whole project is being menu driven makes it


user friendly, it displays required messages wherever necessary.

Reliability: Software reliability concerns with how the program


works in different solutions.....

Sree Narayana Vidya Mandir Senior Secondary School Page 28


ONLINE BUS TICKET

BIBLIOGRAPHY

Sree Narayana Vidya Mandir Senior Secondary School Page 29


ONLINE BUS TICKET

BIBLIOGRAPHY

 Introductory computer science A.K.Sharma

 Computer Science Sumitha Arora

 Computer Science with C++ Preeti Arora,


Pinky Gupta

Sree Narayana Vidya Mandir Senior Secondary School Page 30

Вам также может понравиться