Varanasi Bus Depo Reservation System
Varanasi Bus Depo Reservation System
Project Report
On
Signature
Name:
(Institute PROV No. /FULL No.)
(or)
Head of the Organization/Division:
Name of the Organization:
Address:
(or)
Name of the Guide/Supervisor:
Qualification:
(Self attested copy of the qualification of the guide/Supervisor
to be attached)
ACKNOWLEDGEMENT
We would like to express our deep gratitude and sincere thanks
to all who helped us to complete this project work successfully.
Last but not the least we thank the Almighty God who makes
everything happen.
Prepared by:
CONTENTS
1. Introduction 6
2. Objective and Problem definition 7
3. Analysis and Design 8
4. Technical Tools and Software Specification 9
5. System User Interface 10
6. Coding 16
7. Output 27
8. Conclusion 30
Introduction
This project is limited to the The functions and features used in this project
are listed below:
void name_number(intbooking,charnumstr[100]);
void cancle();
void login();
You can add new features as you like to make this project a better one.
Feasibility study
Feasibility and risk analysis are related in many ways. If project risk is great,
the feasibility of producing quality software is reduced. During product engineering,
however, we concentrate our attention on primary areas of interest.
Technical Feasibility
Economical Feasibility
The Economic feasibility must satisfy the needs of the technical feasibility
and the operational feasibility. It involves the economic feasibility of developing and
implementing the proposed system.
Operational Feasibility
The proposed system should use the internet level then the different types of
end users are involved in the system, so it solves the user’s needs and the organization
needs. And it supports the all users environment.
The project has been built on a system with the following Configuration:-
Hardware specification
Software specification
The project has been built on a system with the following Software requirements:-
1. Main Screen
User Login: Give the user and password and press any key like Enter Key.
After first screen user need to input Number Key for Reservation operation
Now to give Seat No Details and Person Name for a given below screen
Now Continue Ticket Booking for Rest of seats for same bus no
Go to cancel ticket Operation: Press Seat number 0 and Press Enter key to return
Coding
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char ch[10][130]={"Super Delux VARANASI- ALAHABAD Express","VARANASI - AZAMGARH
Superfast Express","Turanto Express VARANASI- LUCKNOW","Janta Express VARANASI-
ALAHABAD","Airport Link CANTT-BABATPUR","City Link Express"};
char name[32][100]={'\0'};
char number[32][2]={'\0'};
int num1[32]={0};
inttrno;
void bus();//for list of bus
voidname_number(intbooking,charnumstr[100]);
void booking();//for booking the tickets
intread_number(inttrno);//for reading the number from the file
voidread_name(inttrno);//for reading the name from the file
void status();//for printing the status by user input
void status_1(inttrno);//for printing the status while booking ticket
voidcancle();
void login();
int main()
{
intnum,i;
login();
do{
system("cls");
printf("\n\n\n");
printf("============= VARANASI BUS DEEPO RESERVATION SYSTEM
===============\n\n\n");
printf("\t\t\t\t\t[1]=> View Bus List\n");
printf("\n");
printf("\t\t\t\t\t[2]=> Book Tickets\n");
printf("\n");
printf("\t\t\t\t\t[3]=>Cancle Booking\n");
printf("\n");
printf("\t\t\t\t\t[4]=> Bus Status Board\n");
printf("\n");
printf("\t\t\t\t\t[5]=> Exit\n\n");
printf("======================================================================\n
\n");
printf("\t\t\tEnter Your Choice:: ");
scanf("%d",&num);
switch(num)
{
case 1:
bus();//for list of bus
break;
case 2:
booking();//for booking the tickets
break;
case 3:
cancle();
break;
case 4:
status();
break;
}
getch();
}while(num != 5);
system("CLS");
printf("\t-------------------------------------------------------------------\n");
printf("\t\t\t\t\tThank You For Using This System\t\t\t\t\t\t\n");
printf("\t-------------------------------------------------------------------\n");
printf("\t\t\t Team Institute Cantt,Varanasi,'O' Level Team ");
getch();
return 0;
}
void bus()
{
system("cls");
printf("\n\n\n");
printf("============= VARANASI BUS DEEPO RESERVATION SYSTEM
===============\n\n\n");
printf("\t\t\t[1] => %s\n",ch[0]);
printf("\n");
printf("\t\t\t[2] => %s\n",ch[1]);
printf("\n");
printf("\t\t\t[3] => %s\n",ch[2]);
printf("\n");
printf("\t\t\t[4] => %s\n",ch[3]);
printf("\n");
printf("\t\t\t[5] => %s\n",ch[4]);
}
void booking()
{
FILE *f1, *fopen();//for reading the seats from the user.
int i=0;
charnumstr[100];
char str1[80]="32",str2[4],str3[4];
int seat1,seat2,booking=0;
system("cls");
printf("============= VARANASI BUS DEEPO RESERVATION SYSTEM
===============\n\n\n");//for entering bus number
bus();//for seeing buses list leastx
printf("Enter the Bus number:--->");
scanf("%d",&trno);
system("cls");
printf("============= VARANASI BUS DEEPO RESERVATION SYSTEM
===============\n\n\n");//for selecting coach
printf("Your Bus Number is %d ********** %s",trno,ch[trno-1]);
status_1(trno);
if(trno==1)
{
f1 = fopen("tr1.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 2)
{
f1 = fopen("tr2.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 3)
{
f1 = fopen("tr3.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}
else if(trno == 4)
{
f1 = fopen("tr4.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}
else if(trno == 5)
{
f1 = fopen("tr5.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}
seat1=atoi(str1);//covert the string into number
if(seat1 <= 0)
{
printf("There is no blank seat in this bus ");
}else
{
printf("\n\n\n\t\t\t\tAvailable Seats:------>%d\n",seat1);
printf("\n\t\t\t\tNumber of Tickets:----->");
scanf("%d",&booking);
printf("\n");
seat1=seat1-booking;
itoa(trno,numstr,10);
name_number(booking,numstr);
printf("\n\t\t\t\tThe Total booking amount is %d",200*booking);
itoa(seat1, str1, 10);
}
//for reading the seats from the user.
if(trno == 1)
{
f1 = fopen("tr1.txt","w");
fputs(str1,f1);
fclose(f1);
}
else if(trno == 2)
{
f1 = fopen("tr2.txt","w");
fputs(str1,f1);
fclose(f1);
}
else if(trno == 3)
{
f1 = fopen("tr3.txt","w");
fputs(str1,f1);
fclose(f1);
}
else if(trno == 4)
{
f1 = fopen("tr4.txt","w");
fputs(str1,f1);
fclose(f1);
}
else if(trno == 5)
{
f1 = fopen("tr5.txt","w");
fputs(str1,f1);
fclose(f1);
}
}
voidname_number(intbooking,charnumstr[100])
{
chartempstr[100],tempstr1[12]="status",tempstr2[12]="number";
int number;
FILE *a,*b;
int i=0;
strcat(numstr,".txt");
strcat(tempstr1,numstr);
strcat(tempstr2,numstr);
a = fopen(tempstr1,"a");//for open the file to write the name in the file
b = fopen(tempstr2,"a");//for open the file for writing the number in the file
for(i=0; i<booking; i++)//for entering the person name and seat number in the file
{
printf("===== Enter the details for ticket no %d ==========\n\n\n",i+1);
printf("\t\t\t\tEnter the seat number:--->");
scanf("%d",&number);
printf("\t\t\t\tEnter the name of person:--->");
scanf("%s",name[number-1]);
printf("\n=====================================================\n\n");
printf("\n");
itoa(number, tempstr, 10);
fprintf(a,"%s ",name[number-1]);
fprintf(b,"%s ",tempstr);
}
fclose(a);
fclose(b);
}
intread_number(inttrno)//for putting the numeric value in the array
{
chartempstr[100],tempstr2[12]="number";
FILE *a,*b;
charnumstr[100];
int i=0,j=0,k;
itoa(trno,numstr,10);
strcat(numstr,".txt");
strcat(tempstr2,numstr);
j++;
}
}
name[i][j]='\0';
k=i;
fclose(b);
}
void status()
{
inti,trno,index=0,j;
char tempname[33][10]={"Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty
","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty
","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty
","Empty ","Empty ","Empty ","Empty ","Empty ","Empty "};
system("cls");
printf("============= VARANASI BUS DEEPO RESERVATION SYSTEM
===============\n\n\n");
}
}
void status_1(inttrno)
{ char tempname[33][10]={"Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty
","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty
","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty ","Empty
","Empty ","Empty ","Empty ","Empty ","Empty ","Empty "};
inti,index=0,j;
printf("Your Bus Number is %d ********** %s",trno,ch[trno-1]);
system("cls");
printf("============= VARANASI BUS DEEPO RESERVATION SYSTEM
===============\n\n\n");
j=read_number(trno);
read_name(trno);
read_name(trno);
status_1(trno);
printf("Enter the seat number:--->");
scanf("%d",&seat_no);
a = fopen(tempstr1,"w+");
b = fopen(tempstr2,"w+");
for(i=0; i<32; i++)
{
if(num1[i] == seat_no)
{
for(j=0; j<32; j++)
{
if(num1[j] != seat_no&& num1[j] != 0)
{
fprintf(b,"%d ",num1[j]);
fprintf(a,"%s",name[j]);
}
else if(num1[j] == seat_no&& num1[j] != 0)
{
strcpy(name[j],"Empty ");
}
}
}
}
fclose(a);
fclose(b);
printf("\n\n");
printf("========================================================================
\n");
printf("\t\t\t\tYour 200 rupees has been Returned\t\t\t\n");
printf("========================================================================
=\n");
}
void login()
{
int a=0,i=0;
charuname[10],c=' ';
charpword[10],code[10];
char user[10]="user";
char pass[10]="pass";
do
{
system("cls");
}
}
while(a<=2);
if (a>2)
{
printf("\nSorry you have entered the wrong username and password for four
times!!!");
getch();
}
system("cls");
}
Output
Conclusion
This project incorporates all requirements of Varanasi Bus Depo Reservation System.
This system has been developed as versatile and uses friendly as possible keeping in
mind the advanced features in this technology.
Using such a project helps the organization in minimizing the time and money
consumed in fulfilling the day-to-day functionality’s and cutting down the expenses
incurred on the same. The real world requirement was satisfied by this system which
provides all services …
Using Turbo C 7 and Code Block IDE, the project was developed. As a whole, the
system was well planned and designed.