bus reservation amit project

37
BUS RESERVATION PROGRAM IN C++ USING TURBO C++ 3.0 Project report submitted in partial fulfillment of the requirement for the award of the Degree of B.Tech in Computer Science and Engineering

description

bus reservation using c++

Transcript of bus reservation amit project

Page 1: bus reservation amit project

BUS RESERVATION PROGRAM IN C++ USING TURBO C++ 3.0  

Project report submitted in partial fulfillment of the requirement for the award of the Degree of B.Tech

in

Computer Science and Engineering  

SUBMITTED BY: SUBMITTED TO:

Amit Kataria Dr. Ritu Sindhu

12-CSE-05 Head of Dept. (CSE)

  SGT INSTITUTE OF ENGINEERING AND TECHNOLOGY, BHUDHERA(GURGAON.), HARYANA (INDIA)

DECLARATION

Page 2: bus reservation amit project

This is to certify that project report entitled “ RIVIEWNOW.IN ”which is submitted by me in partial fulfillment of the requirement for the award of degree B.TECH. from SGT INSTITUTE OF ENGINEERING AND TECHNOLOGY SGT GROUP OF INSTITUTIONS, BHUDHERA(GURGAON.), HARYANA (INDIA) comprises only my original work and due acknowledgement has been made in the text to all other material used.

Date:                                                                                       AMIT KATARIA

ACKNOWLEDGEMENT

Page 3: bus reservation amit project

Completing a task is never one-man effort. It is often the result of invaluable

contribution of number of individuals in a direct or indirect manner that helps in

sharing a making success.

I take this opportunity to express my deep sense of gratitude & whole hearted thanks

to my guide Mr.Girish for his valuable guidance and keep interest and affection

encouragement thought the work.

With due respect, I would like to thank Mr.Girish for her informative and illuminative

guidance.

I thank to all who have directly or indirectly helped me during the course of this task.

Page 4: bus reservation amit project

TABLE OF CONTENTS

1. ABSTRACT2. INTRODUCTION3. SYSTEM STUDY4. STUDY OF EXISTING SYSTEM5. PROPOSED SYSTEM6. INTRODUCTION ABOUT FRONT END7. INTRODUCTION ABOUT BACKEND8. SYSTEM SPECIFICATION9. DATABASE DESIGN10.LOGICAL DESIGN11.WHAT CONTRIBUTION WOULD PROJECT MAKE12.CODING 13.OUTPUT14.FEASIBILITY STUDY15.TECHNICAL feasibility16.OPERATIONAL FEASIBILITY17.ECONOMICAL FEASIBILITY18.TESTING19.OBJECTIVE OF SOFTWARE TESTING 20.PRINCIPLES OF SOFTWARE TESTING21.STRATERGY OF SOFTWARE TESTING22.REFRENCES

Page 5: bus reservation amit project

 ABSTRACT

Traveling is a large growing business in India and other countries. Bus reservation system deals with maintenance of records of details of each passenger who had reserved a seat for a journey. It also includes maintenance of information like schedule and details of each bus.

We observed the working of the Bus reservation system and after going through it, we get to know that there are many operations, which they have to do manually. It takes a lot of time and causes many errors. Due to this, sometimes a lot of problems occur and they were facing many disputes with customers. To solve the above problem, and further maintaining records of items, seat availability for customers, price of per seat, bill generation and other things, we are offering this proposal of reservation system.

By using this software, we can reserve tickets from any part of the world, through telephone lines, via internet. This project provides and checks all sorts of constraints so that user does give only useful data and thus validation is done in an effective way.

INTRODUCTION

Our project is to computerize traveling company to manage data, so that all the transactions become fast and there should not be any error in transaction like calculation mistake, bill generation and other things. It replaces all the paper work. It keeps records of all bills also, giving to ensure 100% successful implementation of the computerized Bus reservation system.

Our reservation system has three modules. First module helps the customer to enquire the availability of seats in a particular bus at particular date. Second module helps him to reserve a ticket. Using third module he can cancel a reserved ticket.

Page 6: bus reservation amit project

SYSTEM STUDY

System study aims at establishing requests for the system to be acquired, development and installed. It involves studying and analyzing the ways of an organization currently processing the data to produce information. Analyzing the problem thoroughly forms the vital part of the system study. In system analysis, prevailing situation of problem is carefully examined by breaking them into sub problems. Problematic areas are identified and information is collected. Data gathering is essential to any analysis of requests. It is necessary that this analysis familiarizes the designer with objectives, activities and the function of the organization in which the system is to be implemented.

Study of existing system

Existing system is totally on book and thus a great amount of manual work has to be done. The amount of manual work increases exponentially with increase in bus services.

Needs a lot of working staff and extra attention on all the records. In existing system, there are various problems like keeping records of

items, seats available, prices of per/seat and fixing bill generation on each bill.

Finding out details regarding any information is very difficult, as the user has to go through all the books manually.

Major problem was the lack of security.

Page 7: bus reservation amit project

Proposed system

The system is very simple in design and to implement. The system requires very low system resources and the system will work in almost all configurations. It has got following features

Ensure data accuracy. Records are efficiently maintained by DBMS. DBMS also provides security for the information. Any person across the world, having internet can access this service. Availability of seats can be enquired very easily. Passengers can also cancel their tickets easily. Minimum time needed for the various processing. Better Service. Minimum time required. This would help the corporation prepare and organize its schedules more

efficiently on the basis of traffic demand.

Introduction about the front end(.NET)

This proposed software is going to be development using the latest technology from Microsoft called Microsoft .NET and it is the software that connects information, people, systems, and devices. It spans clients, servers, and developer tools, consists of:

The .NET Framework 3.0 used for building and running all kinds of software, including Web-based applications, smart client applications, Mobile applications etc.

Development tools, such as Microsoft Visual Studio .NET 2010, which provides an integrated development environment (IDE) for maximizing development productivity with the .NET Framework.

Introduction about the back end(SQL SERVER 2008)

Page 8: bus reservation amit project

Microsoft SQL Server 2008 is comprehensive, integrated data management and analysis software that enables organizations to reliably manage mission-critical information and confidently run today’s increasingly complex business applications. SQL Server 2008 allows companies to gain greater insight from their business information and achieve faster results for a competitive advantage.

SQL Server is the fastest growing Database and Business Intelligence vendor.

SQL Server is more secure than Oracle. Since July 2003 more than 100 critical Oracle database security vulnerabilities have been identified, compared to ZERO for SQL Server for that period.

SYSTEM SPECIFICATION

 Hardware Requirements:

PC with intel core processor(or more config). 512 MB RAM or above. 40 GB Hard Disk or above.

 Software Requirements:

Operating system                    : Windows XP (or latest). Front end                                 : Visual C sharp Platform                                  : ASP.NET (.NET web platform 3.0 or

above) Integrated development environment(IDE): Visual Studio 10.0 Back end                                 : SQL SERVER 2008

DATABASE DESIGN

Page 9: bus reservation amit project

Conceptual design

1.)   Requirement Analysis:

What data is needed?

List of Entities:

Bus Passenger Route Reserves

List of attributes:

Bus:

1. Bus id2. Type

1. AC  (or) Non-AC2. Sleeper (or) Not

Maximum seats

Route information:

1. Route id2. To location3. From location4. Depart date5. Depart time6. Fare

Reserves information:

1. Ticket number2. Passenger id3. Route id

Passenger information:

Page 10: bus reservation amit project

1. Passenger id2. Name3. Mobile number4. E-mail

List of Relations:

Reserves Has

ER-MODEL:

Page 11: bus reservation amit project

Logical design:

1. PASSENGER : Keeps record of passengers.

S.no Field name Data type Description Constraints

1 PID Integer Passenger identity number Primary key

2 Name varchar(20) Name of the passenger

3 Mobile Bigint Mobile number of the passenger

4 Email varchar(30) Email id of the passenger

Schema definition:

CREATE  TABLE  passenger(PID integer primary key,name varchar(20) ,mobile bigint,email varchar(30));

Page 12: bus reservation amit project

2. ROUTE : Keeps record of schedules.

S.no Field name Data type Description Constraints

1 RID Integer Route identity number Primary key

2 BID Integer Bus identity number Foreign key

2 To_location varchar(20) Starting point

3 From_location varchar(20) Destination point

4 Fare Real Fare for journey

5 Depart_date Date Departure date

6 Depart_time time(7) Departure time

Schema definition:

CREATE  TABLE  passenger(RID integer primary key,BID integer,from_location varchar(20) ,to_location varchar(20),Fare real,depart_date date,depart_time time(7),foreign key (bid) references BUS(bid));

Page 13: bus reservation amit project

3. RESERVES : Reservation table.

S.no Field name Data type Description Constraints

1 Ticket_no Integer Ticket number Primary key

2 RID Integer Route identify number Foreign key

3 PID Integer Passenger identity number Foreign key

Schema definition:

CREATE  TABLE  passenger(Ticket_no integer primary key,RID integer,PID integer,foreign key (rid) references ROUTE(rid),foreign key (pid) references PASSENGER(pid));

Page 14: bus reservation amit project

4. BUS: Bus details.

S.no Field name Data type Description Constraints

1 BID Integer Bus identity number Primary key

2 Bname varchar(20) Bus name

2 Max_seats Integer Seats in bus

3 Type_ac varchar(3) Ac or not

4 Type_sleeper varchar(3) Sleeper or not

Schema definition:

CREATE  TABLE  passenger(BID integer primary key,Bname  varchar(20) ,Max_seats Integer,Type_ac varchar(3),Type_sleeper varchar(3))

WHAT CONTRIBUTION WOULD THE PROJECT MAKE?

Page 15: bus reservation amit project

This is an era of information technology where automation of each and every activity is gaining importance. The site will lead to the automation of the rating. Moreover it is far better than the previous such websites.

Computerized vs. Manually

Automated process of examination is much better than the manual system as it has following.

Advantages:

Time saving

Increased efficiency

Allows neat handling of data rather than error prone records.

Decreases overhead

Accurate

CODING

Page 16: bus reservation amit project

#include "conio.h"#include "stdio.h"#include "iostream.h"#include "string.h"#include "graphics.h"#include "stdlib.h"#include "dos.h"static int p=0;class a{

char busn[5],driver[10],arrival[5],depart[5],from[10],to[10],seat[8][4][10];

public:void install();void allotment();void empty();void show();void avail();void position(int i);

}bus[10];void vline(char ch){

for (int i=80;i>0;i--)cout<<ch;

}void a::install(){

cout<<"Enter bus no: ";cin>>bus[p].busn;cout<<"\n Enter Driver's name: ";cin>>bus[p].driver;cout<<"\n Arrival time: ";cin>>bus[p].arrival;cout<<"\n Departure: ";cin>>bus[p].depart;cout<<"\n From: \t\t\t";cin>>bus[p].from;cout<<"\n To: \t\t\t";cin>>bus[p].to;bus[p].empty();p++;

Page 17: bus reservation amit project

}void a::allotment(){

int seat;char number[5];top:cout<<"Bus no: ";cin>>number;int n;for(n=0;n<=p;n++){

if(strcmp(bus[n].busn,number)==0)break;

}while(n<=p){

cout<<"\n Seat number: ";cin>>seat;if (seat>32)

{cout<<"\n There are only 32 seats available in this

bus.";}

else{if (strcmp(bus[n].seat[seat/4][(seat%4)-1],"Empty")==0)

{cout<<"Enter passanger's name: ";cin>>bus[n].seat[seat/4][(seat%4)-1];break;

}else

cout<<"The seat no. is already reserved.\n";}

}if (n>p){

cout<<"Enter correct bus no.\n";goto top;

}}void a::empty(){

Page 18: bus reservation amit project

for(int i=0;i<8;i++){

for(int j=0;j<4;j++){

strcpy(bus[p].seat[i][j],"Empty");}

}}void a::show(){

int n;char number[5];cout<<"Enter bus no: ";cin>>number;for(n=0;n<=p;n++){

if(strcmp(bus[n].busn,number)==0)break;

}while (n<=p){

vline('*');cout<<" Bus no: \t"<<bus[n].busn<<"\n Driver: \t"<<bus[n].driver<<"\t\t Arrival time:\t"<<bus[n].arrival<<"\t Departure time:\t"<<bus[n].depart<<"\n From:\t\t"<<bus[n].from<<"\t\t To: \t\t\t"<<bus[n].to<<"\n";vline('*');bus[0].position(n);int a=1;for (int i=0;i<8;i++){

for(int j=0;j<4;j++){

a++;if(strcmp(bus[n].seat[i][j],"Empty")!=0)

cout<<"\n The seat no "<<a-1<<" is reserved for "<<bus[n].seat[i][j]<<" .";

}}break;

} if(n>p)cout<<"enter correct bus no.";

}

Page 19: bus reservation amit project

void a::position(int l){

int s=0,p=0;for(int i=0;i<8;i++){

cout<<"\n";for(int j=0;j<4;j++){

s++;if(strcmp(bus[l].seat[i][j],"Empty")==0)

{cout.width(5);cout.fill(' ');cout<<s<<".";cout.width(10);cout.fill(' ');cout<<bus[l].seat[i][j];p++;

}else

{cout.width(5);cout.fill(' ');cout<<s<<".";cout.width(10);cout.fill(' ');cout<<bus[l].seat[i][j];

}}

}cout<<"\n\n There are "<<p<<" seats empty in Bus No:

"<<bus[l].busn;}void a::avail(){

for(int n=0;n<p;n++){

vline('*');cout<<"Bus no: \t"<<bus[n].busn<<"\nDriver: \

t"<<bus[n].driver<<"\t\tArrival time:\t"<<bus[n].arrival<<"\tDeparture Time: \t"<<bus[n].depart<<"\n From: \t\t"<<bus[n].from<<"\t\t To: \t\t\t"<<bus[n].to<<"\n";

vline('*');

Page 20: bus reservation amit project

vline('_');}

}void main(){

clrscr();int w;int gd=DETECT,gm;initgraph(&gd,&gm,"d:\\tc\\bgi");//enter the path of ur c compiler where

u installed it.setbkcolor(GREEN);while(1){

cout<<"\n\n\n\n";cout<<"\t\t\t 1.Install\n\t\t\t 2.Reservation\n\t\t\t 3.Show \n\t\t\t

4.Buses Available. \n\t\t\t 5.Exit";cout<<"\n\t\t\t Enter your choice:-> ";cin>>w;switch(w){

case 1:bus[p].install();break;case 2:bus[p].allotment();break;case 3:bus[0].show();break;case 4:bus[0].avail();break;case 5:exit(0);

}}

}

OUTPUT:

Page 21: bus reservation amit project
Page 22: bus reservation amit project

FEASIBILITY STUDY

Page 23: bus reservation amit project

Once scope has been identified (with the concurrence of the customer), it is reasonable to ask: “Can we build software to meet this scope? Is the project feasible?” All too often, software engineers rush past this questions (or are pushed past them by impatient managers or customers), only to becomemired in a project that is doomed from the onset.

When we are developing the system (software), we must know the proposed system will be feasible or i.e. practically implemented or not it may possible the proposed (candidate) system may not implemented due to many reasons like it may take long time in development than the specified time limit ,cost may increase than proposed one etc. Therefore we must analyze the feasibility of the system.

Feasibility is the analysis of risks, costs & benefits relating to economics, technology & user operation.

There are several types of feasibility depending on the aspect they covers. Some important feasibilities is as follows:-

(I) Technical Feasibility (II) Operational Feasibility (III) Economical Feasibility

Economic analysis is the most frequently used evaluating the effectiveness of proposed system, more commonly known as Benefit analysis. The Benefit analysis is to determine benefits and savings which are expected from candidate system and compare them with cost. If the benefits are more than the cost, then decision is made to design and implement the system. The cost and benefits may be direct or indirect and tangible or intangible.

TECHNICAL FEASIBILTIY:-

Page 24: bus reservation amit project

The technically feasibility study basically centers on alternatives for hardware, software and design approach to determine the functional aspects of system.

This project on Bus Reservation is based on c++ .

MS-Access database will be used for storing data.

Hardware requirements used are compatible with all O.S. The system can also be expanded as per the needs of requirement specification.

OPERATIONAL FEASIBILTY:-

Operational Feasibility is a measure of how people are able to work with system. This type of feasibility demands if the system will work when developed and installed.

Since System is very user friendly so users will find it comfortable to work on this code.

ECONOMICAL FEASIBILITY:-

Economic analysis is the most frequently used evaluating the effectiveness of proposed system, more commonly known as Benefit analysis. The Benefit analysis is to determine benefits and savings which are expected from candidate system and compare them with cost. If the benefits are more than the cost, then decision is made to design and implement the system. The cost and benefits may be direct or indirect and tangible or intangible.

TESTING

Page 25: bus reservation amit project

Software testing is the process of executing a program with intension of finding errors inthe code. It is a process of evolution of system or its parts by manual or automatic meansto verify that it is satisfying specified or requirements or not.

Generally, no system is perfect due to communication problems between user anddeveloper, time constraints, or conceptual mistakes by developer.

To purpose of system testing is to check and find out these errors or faults as early aspossible so losses due to it can be saved.

Testing is the fundamental process of software success.

Testing is not a distinct phase in system development life cycle but should be applicablethroughout all phases i.e. design development and maintenance phase.

Testing is used to show incorrectness and considered to success when an error isdetected.

OBJECTIVES OF SOFTWARE TESTING.

The software testing is usually performed for the following objectives:-

SOFTWARE QUALITY IMPROVEMENT: - The computer and the software are mainly used for complex and critical applications and a bug or fault in software causes severe losses. So a great consideration is required for checking for quality of software.

VERIFICATION AND VALIDATION:- Verification means to test that we are building the product in right

way .i.e. arewe using the correct procedure for the development of software so that it can meetthe user requirements.

Validation means to check whether we are building the right product or not.

SOFTWARE RELIABILTY ESTIMATION: - The objective is to discover theresidual designing errors before delivery to the customer. The

Page 26: bus reservation amit project

failure data during processare taken down in order to estimate the software reliability.

PRINCIPLES OF SOFTWARE TESTING

Software testing is an extremely creative and challenging task. Some important principlesof software testing are as given:-

All tests should be traceable to customer requirements. Testing time and resources should be limited i.e. avoid redundant

testing. It is impossible to test everything. Use effective resources to test. Test should be planned long before testing begins i.e. after

requirement phase. Test for invalid and unexpected input conditions as well as valid

conditions. Testing should begin in “in the small” and progress towards testing

“in the large”. For the most effective testing should be conducted by an

independent party. Keep software static (without change mean while) during test. Document test cases and test results. Examining what the software not doing which it expected to do and

also checkingwhat it is doing that was not expected to do.

STRATEGY FOR SOFTWARE TESTING

Different levels of testing are used in the test process; each level of testing aims to test differentaspects of the system.

The first level is unit testing. In this testing, individual components are tested toensure that they operate correctly. It focuses on verification efforts.

The second level is integration testing. It is a systematic technique for constructingthe program structure. In this testing, many tested modules are combined into thesubsystem which are then tested. The good here is to see if the modules can beintegrated properly.

Page 27: bus reservation amit project

Third level is integration testing System testing is actually a series of different testswhose primary purpose is to fully exercise computer based system. These tests falloutside scope of software process and are not conducted solely by software engineers.

REFERENCES

Page 28: bus reservation amit project

The following books were very helpful during the completion of project:

1. Practical C++ Programming Author : O’Riley

2. Code Complete  Author : Steve McConnell   3. Software Engineering Concept Author : Fairle Publisher: Tata McGraw Hill Publication, 3rd Edition

4. Software Engineering Principles Author : Pressman  

5. www.cplusplus.com