Professional Documents
Culture Documents
Project Report ON Bus Reservation System: Submited To
Project Report ON Bus Reservation System: Submited To
PROJECT REPORT
ON
BUS RESERVATION SYSTEM
SUBMITED TO
Shree Somnath Sanskrit College
DEVELOPED BY
Gohel Jatin
14/5/2013
Preface
14/5/2013
After the phase, we have developed the form of the system with the
help of system flow charts, and data/document flow diagram (chart).
14/5/2013
Next we have displayed the screen layouts and reports, which make
our report more effective. At the ending parts, we have started the coding
of our actual application. At the last we have explained the
implementation and testing of four systems.
Acknowledgement
14/5/2013
Project Profile
Project Tile
:-
14/5/2013
Developed By
:-
Gohel Jatin
College
:-
Class
:-
PGDCA SEM-2
Academic Year :-
2012-2013
Software Used :-
C Language
Notepad
Submit To
:-
14/5/2013
Sr. No.
1
CONTENTS
About c
Page no.
8
11
11
12
13
Feasibility Study
14
Design
5.1 Screens/Interfaces
5.2 Scope Of The Project
16
16
64
Testing
65
Bibliography
71
INDEX
About C
14/5/2013
Ken Thompson also at Bell Labs, USA, wrote his own variant of
this and called it B. In due course, the designers of UNIX modified it to
produce a programming language called C. Dennis Ritchie, also at Bell
Labs, is credited for designing C in the early 1970s. Subsequently, UNIX
was rewritten entirely in C. In 1983, an ANSI standard for C emerged
14/5/2013
have also been include. The explanations have been depicted with
suitable diagrams to convey the concepts more effectively. Readers will
be proficient at programming after solving the review questions and
programming exercises given at the end of each chepter. Though every
attempt has made to avoid and check errors, we will be grateful to readers
if they can bring to our notice any errors that may have crept in
inadvertently.
Content and Structure
It contains the lots of structure and it has the wide library functions
and header files. There are different data types and identifiers to develop
a program. There many data types like fundamental data types, derived
data types and user define data types. As we know that c is a procedure
oriented language.
Memory Management
One of the most important functions of a programming language is
to provide facilities for managing memory and the objects that are stored
in memory. C provides three distinct ways to allocate memory for objects:
Static memory allocation: space for the object is provided in the
binary at compile-time; these objects have an extent (or lifetime) as long
as the binary which contains them is loaded into memory.
Automatic memory allocation: temporary objects can be stored on
the stack, and this space is automatically freed and reusable after the
block in which they are declared is exited
14/5/2013
region of memory called the heap; these blocks persist until subsequently
freed for reuse by calling the library function realloc or free
Text File
This C programming tutorial is about Text Files and a followup to
the previous one on Random Access Files. Technically you can do
random access with text files (as opposed to binary) so long as you open
the text file in binary mode. There is virtually no difference between a
text file and a binary file except that the binary file can hold all byte
values and the text file is restricted to a subset. They are both just a
collection of bytes stored on disk. How you process them is the real
difference. We've seen how to process a binary file and in this tutorial we
see how to handle a text file.
What is a Text File?
For simplicity, I'm not considering Unicode in this tutorial. We're
staying in the 7 bit world of ASCII so the highest character code is 127. A
text file is a file that holds ASCII characters organised in multiple length
lines separated by a line break. ASCII character includes
0x7 (bell)
0x8 (backspace)
0x9 (tab)
0xa (line feed)
0xc (Form Feed) Not used so much nowadays
0xd (carriage return)
14/5/2013
Hardware Specification
Hardware
Processor
:-
Intel Pentinum 4
Main Memory :-
256 MB of RAM
Hard Disk
40GB
:-
Software
Operating System :- Windows 98 or Higher
First End Tool
:- C Language
:- Notepad
Project Overview
14/5/2013
Login facility
Menu screen from that you can access any functionality.
Seat Allotment form.
Display all passanger Detail.
Search the information by Name,By Seatno,By Busno.
Delete Alloted seat.
Improve wrong information by update form.
Exit if you want to go out of Application
14/5/2013
LOGIN
DELETE
PASSNGER
ALLOTMENT
PASSNGER
MENU
DISPLAY
ALL
PASSANGE
R
EXIT
SEARCH
PASSANGER
ABOUT US
BY NAME
Feasibility Study
BY BUS
BY SEAT
14/5/2013
installed or not.
Determine the potential of existing system.
Improve the existing system.
Know what should be embedded in the new system.
Define the problems and objective involved in a project.
Avoid costly repairs at a later stage when the system is
implemented.
7) Avoid crash implementation of a new system.
Avoid the hardware approach i.e. getting a computer first
and then deciding how to use it.
Our system is feasible from economical and technical
study how it feasible is explained as follows.
1) Economical Feasibility.
2) Technical Feasibility.
3) Operational Feasibility.
1) Economical:
The software is designed such that the cost is kept at
lower level that any users can easily buy and implement the
14/5/2013
Technical:
Our system made on .NET platform that why all current
equipment include/enter in our system easily.
The system supports the current equipment. It also has the
features to support the new incoming equipment in market, and
available personnel. If new technology is required then changes
can be made according to technology.
3) Operational:
In our system, there are many processes which is done by the
system instead of human bieng thatwhy we can say that our
system is also operational feasible.
There are calculate total price of the bill acording to
your purchase gram. It take the amount of the 10 gram from the
database and calculate net total price.
14/5/2013
void login()
{
char UserName[12]="gohel";
char user[15];
char Password[15]="jatin";
char pass[15];
char again;
do
{
clrscr();
14/5/2013
startgraph();
setcolor(DARKGRAY);
rectangle(450,80,150,220);
line(450,170,150,171);
line(450,120,150,120);
line(300,220,300,120);
setcolor(BROWN);
outtextxy(250,100,"LOGIN FORM");
setcolor(WHITE);
outtextxy(210,145,"User_Id");
gotoxy(42,10);
scanf("%s",&user);
setcolor(GREEN);
outtextxy(210,195,"Password");
gotoxy(42,13);
scanf("%s",&pass);
setcolor(RED);
rectangle(450,80,150,220);
line(450,170,150,171);
14/5/2013
line(450,120,150,120);
line(300,220,300,120);
14/5/2013
setcolor(BROWN);
outtextxy(200,420,"Do U Want To Try Again Y/N");
again=getche();
clrscr();
cleardevice();
}while(again=='y' || again=='Y');
exit(0);
}
Menu Form
14/5/2013
void menu()
{
char ch;
startgraph();
graphi();
14/5/2013
setcolor(15);
settextstyle(1,0,2);
outtextxy(240,80,"BUS RESERVATION");
setcolor(RED);
settextstyle(0,0,0);
setcolor(6);
outtextxy(190,180,"[1] ALLOTMENT PASSANGER");
outtextxy(190,200,"[2] DISPLAY PASSANGER_DETAIL");
setcolor(15);
outtextxy(190,220,"[3] SEARCH PASSANGER_DETAIL");
outtextxy(190,240,"[4] UPDATE PASSANGER_DETAIL");
setcolor(2);
outtextxy(190,260,"[5] DELETE PASSANGER_DETAIL");
outtextxy(190,280,"[6] EXIT ");
setcolor(GREEN);
outtextxy(118,125,"L");
setcolor(BROWN);
outtextxy(126,125,"OGIN");
outtextxy(422,125,"A");
setcolor(GREEN);
outtextxy(430,125,"BOUTUS");
14/5/2013
setcolor(BROWN);
outtextxy(215,350,"ENTER YOUR CHOICE : ");
ch=getch();
endgraph();
clrscr();
fflush(stdin);
switch(ch)
{
case '1':
insert();
break;
case '2':
display();
break;
case '3':
search();
break;
14/5/2013
case '4':
update();
break;
case '5':
del();
break;
case '6':
exit(0);
break;
case 'L':
login();
break;
case 'A':
aboutus();
break;
14/5/2013
default:
printf("\n \t\t\t\t insert valid number :");
break;
}
}
Allotment Form
14/5/2013
void insert()
{
char a='y';
int Sno,Bno;
clrscr();
14/5/2013
while(a=='y' || a=='Y')
{
fseek(fp,0,2);
rewind(fp);
startgraph();
clrscr();
cleardevice();
setcolor(BROWN);
outtextxy(190,15,"ALLOTMENT FORM");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
14/5/2013
scanf("%[^\n]",&s.Cname[p]);
if(s.Cname[p]>=65 && s.Cname[p]<=90 || s.Cname[p]>=97 &&
s.Cname[p]<=122)
{
if(strlen(s.Cname)>25)
{
setcolor(RED);
outtextxy(350,117,"only 20 character use");
delay(1200);
insert();
}
}
else
{
setcolor(RED);
outtextxy(350,120,"Invalid Character");
delay(1200);
insert();
}
printf("\n\t Busno
setcolor(BROWN);
: " );
14/5/2013
outtextxy(0,150,"(1-10)");
fflush(stdin);
scanf("%ld",&Bno);
if(Bno>10)
{
setcolor(RED);
outtextxy(350,150,"only 10 Buses Available");
delay(800);
insert();
}
printf("\n\t Seatno
: " );
setcolor(BROWN);
outtextxy(0,180,"(1-32)");
fflush(stdin);
scanf("%ld",&Sno);
while(fread(&s,recsize,1,fp)==1)
{
if(Sno==s.Seatno && Bno==s.Busno)
{
14/5/2013
setcolor(RED);
outtextxy(350,180,"already existed");
delay(800);
cleardevice();
insert();
}
}
if(Sno==0)
{
setcolor(RED);
outtextxy(350,180,"0 Not Allowed");
delay(800);
insert();
}
if(Sno>32)
{
setcolor(RED);
outtextxy(350,180,"only 32 seat available");
delay(800);
insert();
}
14/5/2013
s.Busno=Bno;
s.Seatno=Sno;
printf("\n\t Date
: " );
fflush(stdin);
scanf("%s",&s.Date[p]);
printf("\n\t Time
: " );
fflush(stdin);
scanf("%s",&s.Time[p]);
printf("\n\t From
: " );
setcolor(BROWN);
outtextxy(0,275,"(Char)");
fflush(stdin);
scanf("%s",&s.From[p]);
14/5/2013
setcolor(RED);
outtextxy(350,280,"only 20 character use");
delay(1200);
insert();
}
}
else
{
setcolor(RED);
outtextxy(350,280,"Invalid Character");
delay(1200);
insert();
}
printf("\n\t To
: " );
setcolor(BROWN);
outtextxy(0,305,"(Char)");
fflush(stdin);
scanf("%s",&s.To[p]);
14/5/2013
: " );
14/5/2013
fwrite(&s,recsize,1,fp);
printf("\n\n\t Do you want to add one more record(y/n)");
a=getche();
clrscr();
endgraph();
}
menu();
}
14/5/2013
Display Form
void display()
{
int no,dis=0;
rewind(fp);
14/5/2013
startgraph();
clrscr();
cleardevice();
setcolor(BROWN+BLINK);
outtextxy(190,15,"DISPLAY INFORMATION FORM");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
while(fread(&s,recsize,1,fp)==1)
{
14/5/2013
:%4s",s.To);
fflush(stdin);
printf("\n\t\t\t Ruppes :%4ld",s.Rs);
fflush(stdin);
printf("\n\n");
printf("\t\t\t----------------------");
printf("\n\t\t\t----------------------");
dis++;
if(dis==2)
{
dis=0;
setcolor(RED);
outtextxy(150,460,"press enter to display more
record");
14/5/2013
getch();
clrscr();
cleardevice();
setcolor(BROWN+BLINK);
outtextxy(190,15,"DISPLAY INFORMATION");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
}
}
endgraph();
getch();
menu();
}
14/5/2013
Search Form
14/5/2013
void search()
{
int flag=0,Sno,Bno,bus;
char nm[75],ch1;
rewind(fp);
startgraph();
clrscr();
cleardevice();
14/5/2013
setcolor(BROWN+BLINK);
outtextxy(190,10,"ENTER THE NAME TO BE
SEARCH ");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
14/5/2013
printf("\n------------------------------------------------------------------------------");
while(fread(&s,recsize,1,fp)!=NULL)
{
if(strcmp(s.Cname,nm)==0)
if(s.Busno==bus)
{
clrscr();
cleardevice();
14/5/2013
setcolor(BROWN+BLINK);
outtextxy(190,10,"SEARCH
INFORMATION BY NAME");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
printf("\n\n\n\t\t\t Name :
%s",s.Cname);
printf("\n\n\t\t\t Busno : %ld",s.Busno);
printf("\n\n\t\t\t Seatno : %ld",s.Seatno);
printf("\n\n\t\t\t Date : %s",s.Date);
printf("\n\n\t\t\t Time : %s",s.Time);
printf("\n\n\t\t\t From : %s",s.From);
printf("\n\n\t\t\t To
: %s",s.To);
printf("\n\n");
14/5/2013
printf("\t\t\t----------------------");
printf("\n\t\t\t----------------------");
flag++;
setcolor(RED);
outtextxy(150,400,"press enter to display
more record");
getch();
//break;
}
}
if(flag==1)
{
getch();
search();
}
if(flag==0)
{
printf("\n\n\t\t\t Record does not exits\n\n");
getch();
14/5/2013
search();
}
break;
case '2':
startgraph();
clrscr();
cleardevice();
setcolor(BROWN+BLINK);
outtextxy(190,10,"ENTER THE SEATNO TO BE
SEARCH ");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
fp=fopen(strcat(LINK,"student.dat"), "rb");
printf("\n\n\tEnter Seatno :");
scanf("%d",&Sno);
14/5/2013
fflush(stdin);
printf("\n------------------------------------------------------------------------------");
printf("\n\n\t Enter BusNo : ");
scanf("%d",&bus);
printf("\n------------------------------------------------------------------------------");
while(fread(&s,recsize,1,fp)==1)
{
if(s.Seatno==Sno)
if(s.Busno==bus)
{
flag=1;
clrscr();
cleardevice();
14/5/2013
setcolor(BROWN+BLINK);
outtextxy(190,10,"SEARCH
INFORMATION BY SEATNO");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
printf("\n\n\n\t\t\t Name :
%s",s.Cname);
printf("\n\n\t\t\t Busno : %ld",s.Busno);
printf("\n\n\t\t\t Seatno : %ld",s.Seatno);
printf("\n\n\t\t\t Date : %s",s.Date);
printf("\n\n\t\t\t Time : %s",s.Time);
printf("\n\n\t\t\t From : %s",s.From);
printf("\n\n\t\t\t To
: %s",s.To);
printf("\n\n");
14/5/2013
printf("\t\t\t----------------------");
printf("\n\t\t\t----------------------");
flag++;
setcolor(RED);
outtextxy(150,400,"press enter to display
more record");
getch();
}
}
if(flag==1)
{
getch();
search();
}
if(flag==0)
{
printf("\n\n\tRecord does not exits\n\n");
getch();
search();
}
14/5/2013
break;
case '3':
startgraph();
clrscr();
cleardevice();
setcolor(BROWN+BLINK);
outtextxy(190,10,"ENTER THE SEATNO TO
BE SEARCH ");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
14/5/2013
{
if(s.Busno==Bno)
{
flag=1;
clrscr();
cleardevice();
setcolor(BROWN+BLINK);
outtextxy(190,10,"SEARCH
INFORMATION BY BUSNO");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
printf("\n\n\n\t\t\t Name :
%s",s.Cname);
printf("\n\n\t\t\t Busno : %ld",s.Busno);
14/5/2013
: %s",s.To);
printf("\n\n");
printf("\t\t\t----------------------");
printf("\n\t\t\t----------------------");
flag++;
setcolor(RED);
outtextxy(150,400,"press enter to display
more record");
getch();
//break;
}
}
if(flag==1)
14/5/2013
{
getch();
search();
}
if(flag==0)
{
printf("\n\n\tRecord does not exits\n\n");
getch();
search();
}
break;
case '4':
menu();
break;
}
getch();
endgraph();
menu();
14/5/2013
Update Form
void update()
{
int flag,bus;
14/5/2013
char nm[75];
rewind(fp);
startgraph();
clrscr();
cleardevice();
setcolor(BROWN+BLINK);
outtextxy(190,10,"UPDATE INFORMATION FORM");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
printf("\n------------------------------------------------------------------------------");
14/5/2013
printf("\n------------------------------------------------------------------------------");
fflush(stdin);
flag=0;
while(fread(&s,recsize,1,fp)==1)
{
if(strcmp(s.Cname,nm)==0)
if(s.Busno==bus)
{
flag=1;
}
}
if(flag==0)
{
delay(700);
printf("\n\n\t\t\t Record do not exist");
}
rewind(fp);
while(fread(&s,recsize,1,fp)==1)
{
if(strcmp(s.Cname,nm)==0)
14/5/2013
{
printf("\n\t\t\t Enter New Data ");
printf("\n------------------------------------------------------------------------------");
printf("\n\n\t\t\t Name
: ");
scanf("%[^\n]",&s.Cname);
printf("\n\t\t\t Busno
: ");
fflush(stdin);
scanf("%ld",&s.Busno);
printf("\n\t\t\t Seatno
: ");
fflush(stdin);
scanf("%ld",&s.Seatno);
printf("\n\t\t\t Date
fflush(stdin);
scanf("%s",&s.Date);
: ");
14/5/2013
printf("\n\t\t\t Time
: ");
fflush(stdin);
scanf("%s",&s.Time);
printf("\n\t\t\t From
: ");
fflush(stdin);
scanf("%s",&s.From[p]);
printf("\n\t\t\t To
: ");
fflush(stdin);
scanf("%s",&s.To[p]);
printf("\n\t\t\t Rupees
: ");
fflush(stdin);
scanf("%ld",&s.Rs);
delay(800);
printf("\n\n\t\t\t Record is successfully updated");
fseek(fp,-recsize,1);
fwrite(&s,recsize,1,fp);
14/5/2013
break;
}
}
getch();
menu();
}
Delete Form
14/5/2013
void del()
{
int recno;
int bus;
char ch;
startgraph();
clrscr();
cleardevice();
setcolor(BROWN+BLINK);
outtextxy(190,10,"DELETE INFORMATION ");
gotoxy(2,2);
printf("\n------------------------------------------------------------------------------");
14/5/2013
scanf("%d", &recno);
printf("\n------------------------------------------------------------------------------");
printf("\n\t\t
scanf("%d",&bus);
printf("\n------------------------------------------------------------------------------");
: %s",s.To);
14/5/2013
printf("\n\n");
printf("\t\t\t----------------------");
printf("\n\t\t\t----------------------");
14/5/2013
{
fwrite((char *)&s, recsize, 1, ft);
}
}
delay(500);
outtextxy(190,470,"Record is Succesfully deleted");
}
else
outtextxy(190,400,"Record does not found");
fclose(fp);
fclose(ft);
remove(strcat(LINK,"student.txt"));
rename(strcat(LINK,"temp.txt"), strcat(LINK,"student.txt"));
fp=fopen("student.txt","rb+");
rewind(fp);
getch();
endgraph();
menu();
}
14/5/2013
AboutUs Form
14/5/2013
void aboutus()
{
clrscr();
startgraph();
setcolor(BROWN);
settextstyle(0,HORIZ_DIR,1);
outtextxy(50,40,"PROJECT DEVLOPER \n");
outtextxy(200,40,"\t : ");
outtextxy(250,40,"GOHEL JATIN");
14/5/2013
outtextxy(50,120,"PROJECT TITLE");
outtextxy(200,120,"\t : ");
outtextxy(250,120,"BUS RESERVATION SYSTEM");
settextstyle(0,HORIZ_DIR,1);
outtextxy(50,180,"GUIDED BY");
outtextxy(200,180,"\t : ");
outtextxy(250,180,"Prof. Dhara Lakhani");
settextstyle(0,HORIZ_DIR,1);
outtextxy(50,260,"DEVELOPED IN");
outtextxy(200,260,"\t : ");
outtextxy(250,260,"SHREE SOMNATH SANSKRIT
COLLEGE");
outtextxy(250,290,"VERAVAL");
settextstyle(0,HORIZ_DIR,1);
outtextxy(50,340,"SUBMITTED TO");
outtextxy(200,340,"\t : ");
outtextxy(250,340,"SHREE SOMNATH SANSKRIT");
14/5/2013
outtextxy(250,370,"UNIVERSITY.");
getch();
endgraph();
}
14/5/2013
14/5/2013
Testing
Software testing is any activity aimed at evaluating an attribute or
capability of a system and determining that it meets its required results.
So the testing is the process of executing the program with the explicit
intention of finding errors, i.e. make program fails.
The Testing process goes hand in hand with the development
process. Testing is more than just debugging. The purpose of testing can
be quality assurance, verification and validation, or reliability
estimation.
Testing can be used as a generic metric as well. Correctness
testing and reliability testing are two major areas of testing. Software
testing is a trade-off between budget, time and quality. Software testing
should not only be limited to testing software implementation, but also
to testing software design.
a) Testing Method
White box and black box testing are terms used to describe the
Black box being an external view of the test object and white
testing involves much more than just running the program a few times
to see whether it works.
14/5/2013
have and follow a set of testing principles. This enhances the efficiency
of testing within SQA team members and thus contributes to increased
productivity.
There are genrally three main methods of software testing carried out:
Unit Testing: In which each unit (basic component) of the software
is tested to verify that the detailed design for the unit has been correctly
implemented. Tests the minimal software component, or module.
Integration testing: In which progressively larger groups of tested
software components corresponding to elements of the architectural
design are integrated and tested until the software works as a whole.
14/5/2013
requirements:
Acceptance testing: Upon which the acceptance of the complete
software is based, can be conducted by the client. It allows the end-user,
customer or client to decide whether or not to accept the product.
Acceptance testing may be performed after the testing and before the
implementation phase.
Functional testing : Tests the product according to programmable
work.this will cover functional tests from users, perspective like input
is properly accepted and output properly produced.
Code testing: Tests the product according to programmable
work.this will cover functional tests from users, perspective like input
is properly accepted and output properly produced.
Code testing: This test will check the code is written in proper and
consistent manner.
Navigation testing: This test will test navigational controls at
various instances of form operation.
Cosmetic testing: This test will test the appearance of various forms
and user interface.
14/5/2013
specification.
Check weather hot keys are defined for that item for key-board
navigation.
Check for possibilty of under and over flow for every
variable/expression.
Check the calculated field with 3-4 different values or
combination of values
Check weather the inserted records reaches the destination
table.
Form Level:
Query Level:
14/5/2013
Program Level:
Understandability: Selection of meaningful variable name.
Program should not contain
cryptic codes
block of code.
Navigation level:
Form should remain stable and should not respond in weired
Pressing of tab key on last field should take you to the first and
14/5/2013
Conclusion
14/5/2013
Bibliography
Graphics using C (Bharat Prakashan)
www.google.co.in
www.codeproject.com/windows
www.cgraphics.com