Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 73

14/5/2013

PROJECT REPORT
ON
BUS RESERVATION SYSTEM

SUBMITED TO
Shree Somnath Sanskrit College

DEVELOPED BY
Gohel Jatin

14/5/2013

Preface

14/5/2013

The purpose of this project is to learn and implement the concepts


that we have learned during the previous all semester. A software
professionals role is just that to engineer solutions. All the practical and
theory those we have learned during last years and the concept that are
confronted were actually implemented in the field to solve the real time
problems with real data.

Any solution is the result of integration of the theory as well as


practical. Hence this report too, is mixing of theory and practical those we
have done. This would enable the understanding of the methodologies
adopted for the implementation of the application system more rounded.

One of the most important uses of project report is to provide


information so that anybody can understand the whole system of the
project report. It is thus very important aspects of the real system.

First we have started with the introduction the definition of the


project. We have explained the information system and development
strategy, which we have used for our system. We have provided the
process of the system development.

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

Our project is itself an Acknowledgment to the contribution


of many collage.This report is express the details information about our
project topic Bus Reservation SystemWe would like to extend our
sincere thanks to number of reviewers who has been extremely helpful in
giving comments and suggestions during development of our project.

First of all we sincerely thank our university for keeping


such a dynamic activity in our curriculum. This project has helped us a lot
in enhancing our practical knowledge and also in giving a great boost in
our confidence. This would help us a lot when we are there in wide field
of Information Technology and Computer Application.

We would like to thank our project in charge, and our


Project internal guide Prof. Lakhani Dhara for giving constant guidance,
encouragement and make helpful suggestions.

Project Profile
Project Tile

:-

Bus Reservation System

14/5/2013

Developed By

:-

Gohel Jatin

College

:-

Shree Somnath Sanskrit College

Class

:-

PGDCA SEM-2

Academic Year :-

2012-2013

Software Used :-

C Language

Back End Script:-

Notepad

Submit To

Shree Somnath Sanskrit College

:-

14/5/2013

Sr. No.
1

CONTENTS
About c

Page no.
8

2.1 Hardware and Software Specification


2.2 Project Overview
2.3 Software Development Life Cycle

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

System Requirement specification

INDEX

About C

14/5/2013

The story started with the Common Programming Language (CPL)


which Martin Richards at the University of Cambridge turned into Basic
Combined Programming Language (BCPL). This was essentially a typeless language, which allowed the user direct access to the computer
memory. This made it useful to system programmers.

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

Since the evolution of computers, a variety of programming


languages have come into existence. C stands out general-purpose
programming languages for its unrivaled mix of portability, flexibility,
and efficiency. It is a versatile language and is commonly used for
developing application and system programs. C has block structures,
stand-alone functions, a compact set of keywords, and very restrictions.
For all these reasons, learning and using c is necessity for most
programmers.
About the Book
This book is intended for an introductory course on programming
in c. it assumes no prior programming experience in c or any other
language. Readers will find the explanations lucid and effective. Every
feature of C has been demonstrated with appropriate programs tested and
run on a computer. The output obtained after executing these programs

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

Dynamic memory allocation: blocks of memory of arbitrary size


can be requested at run-time using library functions such as malloc from a

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)

System Requirement Specification

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

Back End Tool

:- Notepad

Project Overview

14/5/2013

The Bus Reservation Syatem Application is fully depends on the


Admin side this Application can support following functionality such as

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

Software Development Life Cycle

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

A Feasibility study is undertaken to determine the possibility or


probability of either improving the existing system or developing a
completely new system.
It helps to obtain an overview of the problem and to get rough
assessment of whether feasible solution exists. This is essential to avoid
committing large resources to a project and then report on it later.

Needs For Feasibility Study


The feasibility study is needed to
1) Answer the questions whether a new system is to be
2)
3)
4)
5)
6)

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

system. Updating the software is also possible at lower cost.


That why our system is lower cost because there are not
need to any stationeries and also less paper work.
2)

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.

System Design and Code


Login Form

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);

if((strcmp(UserName,user)==0) && (strcmp(Password,pass)==0))


{
clrscr();
cleardevice();
delay(100);
setcolor(RED);
outtextxy(260,150,"LOGIN SUCCESSFULLY");
setcolor(BROWN);
outtextxy(260,350,"WAITING FOR FEW SECONDS");
delay(1400);
clrscr();
menu();
}
else
{
setcolor(RED);
outtextxy(200,320,"WRONG USERNAME AND PASSWORD");
}

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------------------------------------------------------------------------------");

printf("\n\n\n\n\t PassangerName : " );


setcolor(BROWN);
outtextxy(0,117,"(Char)");
fflush(stdin);

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]);

if(s.From[p]>=65 && s.From[p]<=90 || s.From[p]>=97 &&


s.From[p]<=122)
{
if(strlen(s.From)>20)
{

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

if(s.To[p]>=65 && s.To[p]<=90 || s.To[p]>=97 &&


s.To[p]<=122)
{
if(strlen(s.To)>20)
{
setcolor(RED);
outtextxy(350,310,"only 20 character use");
delay(1200);
insert();
}
}
else
{
setcolor(RED);
outtextxy(350,310,"Invalid Character");
delay(1200);
insert();
}
printf("\n\t Rupees
fflush(stdin);
scanf("%ld",&s.Rs);

: " );

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)
{

printf("\n\n\n\t\t\t Name :%s",s.Cname);


fflush(stdin);
printf("\n\t\t\t Busno :%4d",s.Busno);
fflush(stdin);
printf("\n\t\t\t Seatno :%4d",s.Seatno);
fflush(stdin);

14/5/2013

printf("\n\t\t\t Date :%4s",s.Date);


fflush(stdin);
printf("\n\t\t\t Time :%4s",s.Time);
fflush(stdin);
printf("\n\t\t\t From :%4s",s.From);
fflush(stdin);
printf("\n\t\t\t To

:%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

Search By Seatno Form

14/5/2013

void search()
{
int flag=0,Sno,Bno,bus;
char nm[75],ch1;
rewind(fp);
startgraph();
clrscr();
cleardevice();

printf("\n\n\n\n\t\t\t 1>. Search by name");

14/5/2013

printf("\n\n\t\t\t 2>. Search by Seatno\n");


printf("\n\t\t\t 3>. Search by Busno \n");
printf("\n\t\t\t 4>. Back\n");

printf("\n\n\n\n\t\t\t Enter Your Choice :");


ch1=getch();
switch(ch1)
{
case '1':
startgraph();
clrscr();
cleardevice();

setcolor(BROWN+BLINK);
outtextxy(190,10,"ENTER THE NAME TO BE
SEARCH ");
gotoxy(2,2);

printf("\n------------------------------------------------------------------------------");

14/5/2013

printf("\n------------------------------------------------------------------------------"); fp=fopen(strcat(LINK,"student.dat"), "rb");

printf("\n\n\t\t\t Enter Name : ");


scanf("%[^\n]",nm);
fflush(stdin);

printf("\n\t\t\t Enter BusNo : ");


scanf("%d",&bus);

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\t\t\t Ruppes : %ld",s.Rs);

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\t\t\t Ruppes : %ld",s.Rs);

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------------------------------------------------------------------------------");

printf("\n------------------------------------------------------------------------------"); fp=fopen(strcat(LINK,"student.txt"), "rb");

printf("\n\n\tEnter Busno :");


scanf("%d",&Bno);
fflush(stdin);
while(fread(&s,recsize,1,fp)==1)

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

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\t\t\t Ruppes : %ld",s.Rs);

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------------------------------------------------------------------------------");

printf("\n\n\t\t\t Enter name : ");


scanf("%[^\n]",nm);
fflush(stdin);

printf("\n\t\t\t Enter BusNo : ");


scanf("%d",&bus);

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------------------------------------------------------------------------------");

printf("\n------------------------------------------------------------------------------"); fp=fopen(strcat(LINK,"student.txt"), "rb");


ft=fopen(strcat(LINK,"temp.txt"), "wb");

printf("\n\n\t\t Enter the Seatno Number to delete : ");

14/5/2013

scanf("%d", &recno);

printf("\n------------------------------------------------------------------------------");
printf("\n\t\t

From which Bus : ");

scanf("%d",&bus);

printf("\n------------------------------------------------------------------------------");

while((fread((char *)&s, recsize, 1, fp))==1)


{
if(s.Seatno==recno)
if(s.Busno==bus)
{
printf("\n\n\n\t\t\t Name : %s",s.Cname);
printf("\n\t\t\t Busno : %ld",s.Busno);
printf("\n\t\t\t Seatno : %ld",s.Seatno);
printf("\n\t\t\t Date : %s",s.Date);
printf("\n\t\t\t Time : %s",s.Time);
printf("\n\t\t\t From : %s",s.From);
printf("\n\t\t\t To

: %s",s.To);

14/5/2013

printf("\n\t\t\t Ruppes : %ld",s.Rs);

printf("\n\n");
printf("\t\t\t----------------------");
printf("\n\t\t\t----------------------");

printf("\n\n\t\t\t Seatno %ld for Delete : ", s.Seatno);


printf("\n\n");

printf("\t\t\t Do you want to delete this record : ?


(Y/N)");
fflush(stdin);
scanf("%c", &ch);
}
}
if(ch=='y'||ch=='Y')
{
rewind(fp);
while((fread((char *)&s, recsize, 1, fp))==1)
{
if(recno!=s.Seatno)

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();
}

Scope Of The Project

14/5/2013

An BusReservation System needs to store information pertaining to its


users (or customers),
Functions for Users:
Log in
Search for Property based on one or more following criteria
Name
Busno
Seatno

Access their own Property


Put request of Property as per their requirement

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

point of view a test engineer takes when designing test cases.

Black box being an external view of the test object and white

box being an internal view.

Software testing is partly intuitive, but largely systematic. Good

testing involves much more than just running the program a few times
to see whether it works.

14/5/2013

Software Testing is the process of executing software in a

controlled manner; in order to answer the question Does this software


behave as specified? Software testing is used in association with
verification and validation.

Verification is the checking of or testing of items, including

software, for conformance and consistency with an associated


specification. Software testing is just one kind of verification, which
also uses techniques such as reviews, inspections, and walk-throughs.

Validation is the process of checking what has been specified is

what the user actually wanted


Validation: Are we doing the right job?.
Verification: Are we doing the job right?

In order to achieve consistency in testing, , it is imperative to

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

Exposes defects in the interfaces and interaction between integrated


components (modules).
System testing: In which the software is integrated to the overall
product and tested to show that all requirements are met. Tests an
integrated system to verify/validate that it meets its requirements.

Further method of testing is also done, in accordance with

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

(b) Testing Levels:


Field Level :

Check for all the validation as mentioned in the program

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.

Check all fields are stored properly if filled with maximum


possible characters.

Check for boundary condition, if apply.

Check in case of update, the data before and after update.

Check each and every integrity constraints.

Check for inter module table updates.

Form Level:

Query Level:

14/5/2013

First execute the query without defining any criteria. This


should fetch all the transaction of base table.

Program Level:
Understandability: Selection of meaningful variable name.
Program should not contain
cryptic codes

and cryptic data-name

Comments used should be simple and


precise

Readability: The code should have proper indentation.


Too many condition or statements should
not be placed on in one line.

Maintability: Comments should be present at the beginning of


every logical

block of code.

Navigation level:
Form should remain stable and should not respond in weired

manner on pressing any normal key.

The navigation of the form should proceed from left to right.

Pressing of tab key on last field should take you to the first and

from first to last.


Tips for good testing is dont hide your bugs..

14/5/2013

Conclusion

The Bus Reservation System is a project build with an attempt

to save time and energy. This is a totally computerized project that


makes the work of the Bus Reservation very easy and accurate and
hence saves time and human efforts.

The project is quite user friendly and so no special academic

or technical experience and/or background are required for end-user.


Any person with some knowledge of computer can easily operate it.

14/5/2013

Bibliography
Graphics using C (Bharat Prakashan)
www.google.co.in
www.codeproject.com/windows
www.cgraphics.com

You might also like