You are on page 1of 29

PRABHAT SENIOR

SECONDARY PUBLIC
SCHOOL
ANNUAL PROJECT
REPORT ON
TRAIN RESEVATION
Under Guidance of:

Compiled By:

Mr S.Tripathi

Shashank kumar

C.sc teacher

Roll no.-34
Class-11 Science

Certificate
This is to certify that
Shashank kumar of class 11
sci. has worked under my
supervision on
Train Reservation
and completed to my total
satisfaction.

Mr. Sandeep Tripathi


Mathur

Dr. Namita

Computer Teacher

Principal

Acknowledg
ment
I would like to express my deep
sense of gratitude from the apex
of my heart to our esteemed
guide Mr.Sandeep Tripathi for his
constant encouragement and
noble guidance.
I would express my thanks to my
parents for their valuable
guidance support and for all sorts
of assistance for completing this
project.
Shashank kumar
11 science

Index
1. Overview of C++
2. Objective
3. Inputs to the project
4. Output to the project
5. Process and logic
6. Limitations of the project
7. Tools, language to be used
8. Scope of future applications
9. Description of user defined function
10. Coding of the program
11. Screenshots
12. Bibliographies

Overview of
C++
The C++ language was developed at
AT&T bell Laboratories in the early
1980s by Bjarne Stoustrup. He found
C lacking for stimulations and
decided to extend the language by
adding features from his favourite
language simula 67. Simula 67 was
one of the earliest object oriented
languages. Bjarne Stoustrup called it
C with the classes originally the
name c++ was coined by Rick
Mascitti where ++ is increment
operato

The maturation of the c++ language is


attested by 2 recent events:
1. The formation of American National
Standard (ANSI) C++ committee.
2. The publication of the annotated C++
reference manual by allies and Stoustrup.
Tokens:
The smallest individual unit in a program
is known as token or lexical unit.
C++ has following tokens:
- Keyword
- Identifiers
- Literals
- Punctuators
- Operators

Objective
Objective of this project is to
know how a railway is

managed. In todays time


people want everything fast
so it will be very useful to
have everything
computerised instead of
doing manual entries. It
would be a tedious task to
manage records manually.
Manual entries are mostly
unsafe and can be easily lost
whereas the entries in the
computer are safe and cannot
be easily tampered with.

Inputs

We need the following


inputs:
1. The choice of the user from the
main menu
2. The information about the person
from his name, city, state, age and
destination

Output

The following are the


outputs for the input
mentioned above:
1. When you enter the users
choice you go to the link page
from the main menu
2. After all the choices are
entered on clicking the option the
fare is displayed on the screen.

Limitations of the
project

A. the project does not show the


very minute information
B. the billing of trains is fixed for the
customer for easy calculation
C. the record of the passenger is
unavailable.
D. the person information entered is
not stored in any form.

Tools and language


to be used
Tools:Hardware
1. CPU
2. Monitor

3. Mouse
4. Keyboard

Software
Microsoft office 2013
Turbo C++

Languages
C++ codes during programing the project
English language while the entries are being
made
Numbers wherever needed and asked for

Scope of future
applications
This project can be used in
the future for many
purposes.

1. It can even be used in the railways, to


make the projections more beautiful and
rich
2. The project is colourful and will attract
many people.
3. It can be used for online and quick
reference and reach of the customers.

DESCRIPTION OF USER DEFINED


FUNCTION
RESERVATION ( ); - THIS FUNCTION SHOWS
US THE PAGE FROM WHERE YOU CAN ENTER
THE INFORMATION OF PASSENGERS.
RESEVATION ENQUIRY ( );-THIS FUNCTION
SHOWS US THE FULL INFORMATION ABOUT
THE PASSENGER WHO IS TRAVELLING.

TRAIN ENQUIRY ( );-THIS FUNCTION GIVES


THE LIST OF ARIVAL AND DEPARTURE TIME
OF TRAINS.
CANCEL RESERVATION ( );-THIS FUNCTION
HELPS US TO CANCEL THE RESERVATION.

Header files
used
1. iostream.h
2. conio.h
3. string.h
4. process.h

5. stdlib.h
6. stdio.h

CODING
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<process.h>
void choice(int);
void choice1(int);
void reservation();
void enquiry();
void careserve();
void reserveen();
struct reserve
{
char name[50];
int age;

char state[50];
char city[50];
char to[50];
char redate[50];
char where[50];
char train[50];
}reserve1[50];
void main()
{
clrscr();
textcolor(3);
gotoxy(33,5);
cprintf("PROJECT");
textcolor(3);
gotoxy(35,10);
cprintf("ON");
textcolor(3+BLINK);
gotoxy(29,14);
cprintf(" 'TRAIN RESERVATION' ");
textcolor(3);
gotoxy(35,18);
cprintf("FOR");
textcolor(3);
gotoxy(20,22);
cprintf("THE FULFILLMENT OF ANNUAL EXAMINATION");
textcolor(3);
gotoxy(35,26);
cprintf("IN");
textcolor(3);
gotoxy(27,30);
cprintf("PRABHAT PUBLIC SCHOOL");
textcolor(GREEN);

gotoxy(24,34);
cprintf("##### COMPUTER PROJECT #####");
textcolor(RED);
gotoxy(3,38);
cprintf(" CLASS TEACHER :");
textcolor(GREEN);
gotoxy(3,42);
cprintf("Mr.SANDEEP TRIPATHI");
textcolor(RED);
gotoxy(55,38);
cprintf("* MADE BY:");
textcolor(GREEN);
gotoxy(55,42);
cprintf("S.A.S");
getch();
clrscr();
textcolor(3+BLINK);
gotoxy(13,5);
cprintf("****************WELCOME TO TRAIN RESERVATION****************");
textcolor(YELLOW);
gotoxy(20,10);
cprintf("1. RESERVATION");
textcolor(YELLOW);
gotoxy(20,15);
cprintf("2. VIEW RESERVATION ENQUIRY");
textcolor(YELLOW);
gotoxy(20,20);
cprintf("3. VIEW TRAIN ENQUIRY");
textcolor(YELLOW);
gotoxy(20,25);
cprintf("4. CANCEL RESERVATION");
textcolor(YELLOW);

gotoxy(20,30);
cprintf("5. EXIT");
textcolor(3);
gotoxy(20,35);
cprintf("* ENTER CHOICE(1-5)");
int ch=0;
cin>>ch;
choice(ch);
}
void choice(int a)
{
switch(a)
{
case 1:
reservation();
break;
case 3:
enquiry();
break;
case 2:
reserveen();
break;
case 4:
careserve();
break;
case 5:
break;
}
}
void reservation()
{
int i=0;

clrscr();
textcolor(YELLOW);
gotoxy(20,5);
cprintf("* RESERVATION");
textcolor(YELLOW);
gotoxy(20,8);
cprintf("PASSENGER NAME:");
gotoxy(35,8);
gets(reserve1[i].name);
textcolor(YELLOW);
gotoxy(20,10);
cprintf("ENTER YOUR AGE:");
gotoxy(35,10);
cin>>reserve1[i].age;
textcolor(YELLOW);
gotoxy(20,12);
cprintf("STATE:");
gotoxy(27,12);
gets(reserve1[i].state);
textcolor(YELLOW);
gotoxy(20,14);
cprintf("CITY:");
gotoxy(27,14);
gets(reserve1[i].city);
textcolor(YELLOW);
gotoxy(20,16);
cprintf("From Where:");
gotoxy(32,16);
gets(reserve1[i].to);
textcolor(YELLOW);
gotoxy(45,16);
cprintf("To Where:");

gotoxy(55,16);
gets(reserve1[i].where);
textcolor(YELLOW);
gotoxy(20,18);
cprintf("Enter Reservation Date:");
gotoxy(45,18);
gets(reserve1[i].redate);
textcolor(YELLOW);
gotoxy(20,20);
cprintf("TRAIN NAME :");
gotoxy(32,20);
gets(reserve1[i].train);
if(reserve1[i].train[0]=='S'||reserve1[i].train[0]=='s')
{
gotoxy(20,25);
cout<<"TICKET FARE Rs.500";
}
if(reserve1[i].train[0]=='B'||reserve1[i].train[0]=='b')
{
gotoxy(20,25);
cout<<"TICKET FARE Rs.400";
}
if(reserve1[i].train[0]=='R'||reserve1[i].train[0]=='r')
{
gotoxy(20,25);
cout<<"TICKET FARE Rs.300";
}
if(reserve1[i].train[0]=='a'||reserve1[i].train[0]=='A')
{
gotoxy(20,25);
cout<<"TICKET FARE Rs.500";
}

int ch34;
gotoxy(20,30);
cout<<"RETURN TO MAIN MENU PRESS 0 ";
cin>>ch34;
if(ch34==0)
main();
getch();
}
void enquiry()
{
clrscr();
textcolor(RED);
gotoxy(30,5);
cprintf("* TRAIN ENQUIRY");
gotoxy(5,10);
cprintf("NAME OF TRAINS");
gotoxy(30,10);
cprintf("ARRIVALL TIME");
gotoxy(60,10);
cprintf("DEPARTURE TIME");
textcolor(YELLOW);
gotoxy(5,15);
cprintf("SHATABDI ");
gotoxy(30,15);
cprintf("6:00a.m.");
textcolor(YELLOW);
gotoxy(60,15);
cprintf("6:15a.m.");
gotoxy(5,20);
cprintf("MAHARAJA EXPRESS");
gotoxy(30,20);
cprintf("6:30a.m");

gotoxy(60,20);
cprintf("6:45a.m");
gotoxy(5,25);
cprintf("RAJDHANI");
gotoxy(30,25);
cprintf("7:00a.m");
gotoxy(60,25);
cprintf("7.45a.m");
gotoxy(5,30);
cprintf("GARIB RATH");
gotoxy(30,30);
cprintf("8:00a.m");
gotoxy(60,30);
cprintf("8:15a.m");
textcolor(RED);
gotoxy(20,35);
int ch54=0;
cprintf("* ENTER CHOICE(1-4) TO RETURN TO MAIN MENU PRESS 0");
cin>>ch54;
if(ch54==0)
main();
else
choice1(ch54) ;
}
void choice1(int b)
{
clrscr();
switch(b)
{
case 1:
textcolor(GREEN);
gotoxy(30,5);

cout<<"SHATABDI";
gotoxy(5,10);
cout<<"TOTAL SEATS 50";
gotoxy(5,12);
cout<<"ABOVE 15 YEARS - FULL TICKET";
gotoxy(5,14);
cout<<"5 to 10 YEARS - HALF TICKET";
textcolor(RED);
gotoxy(5,16);
cout<<"RUNNING DAYS : MONDAY,WEDNESDAY,SATURDAY";
break;
case 3:
gotoxy(30,5);
cout<<"RAJDHANI";
gotoxy(5,10);
cout<<"TOTAL SEATS";
gotoxy(5,12);
cout<<"ABOVE 15 YEARS - FULL TICKET";
gotoxy(5,14);
cout<<"5 to 10 YEARS - HALF TICKET";
textcolor(RED);
gotoxy(5,16);
cout<<"RUNNING DAYS : TUESDAY,THURSDAY,FRIDAY";
break;
case 2:
gotoxy(30,5);
cout<<"MAHARAJA EXPRESS";
gotoxy(5,10);
cout<<"TOTAL SEATS";
gotoxy(5,12);
cout<<"ABOVE 15 YEARS - FULL TICKET";
gotoxy(5,14);

cout<<"5 to 10 YEARS - HALF TICKET";


textcolor(RED);
gotoxy(5,16);
cout<<"RUNNING DAYS : DAILY";
break;
case 4:
gotoxy(30,5);
cout<<"GARIB RATH";
gotoxy(5,10);
cout<<"TOTAL SEATS";
gotoxy(5,12);
cout<<"ABOVE 15 YEARS - FULL TICKET";
gotoxy(5,14);
cout<<"5 to 10 YEARS - HALF TICKET";
textcolor(RED);
gotoxy(5,16);
cout<<"RUNNING DAYS : DAILY";
break;
}
int ch32;
gotoxy(5,20);
cout<<"PRESS 0";
cin>>ch32;
if(ch32==0)
enquiry();
}
void reserveen()
{
clrscr();
char na[80];
textcolor(YELLOW);
int ag;

gotoxy(30,5);
cprintf("RESERVATION ENQUIRY");
gotoxy(10,10);
cprintf("Enter your name:");
gets(na);
textcolor(YELLOW);
gotoxy(10,15);
cprintf("Enter your age:");
cin>>ag;
textcolor(YELLOW);
gotoxy(10,20);
cprintf("TRAIN NAME :");
gets(na);
for(int i=0;i<6;i++)
{
int n=strcmp(na,reserve1[i].name);
if(n==0)
{
gotoxy(10,25);
cout<<"YOUR RESERVATION HAS BEEN SUCESSFULLY DONE.";
}
}
int ch40;
gotoxy(10,30);
cout<<"PRESS 0";
cin>>ch40;
if(ch40==0)
main();
getch();
}
void careserve()
{

clrscr();
textcolor(YELLOW);
gotoxy(25,5);
cprintf("* CANCEL RESERVATION *");
gotoxy(10,10);
cprintf("Enter your name:");
char na1[80];
gets(na1);
textcolor(YELLOW);
gotoxy(10,15);
int ag1;
cprintf("Enter your age :");
cin>>ag1;
textcolor(YELLOW);
gotoxy(10,20);
char na2[80];
cprintf("TRAIN NAME :");
gets(na2);
gotoxy(10,25);
cout<<"YOUR RESERVATION HAS BEEN CANCELLED.";
getch( );
}

SCREEN
SHOTS

Bibliography
1.Textbook Sumita
Arora
2.Internet
3.Wikipedia

You might also like