Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
40 views16 pages

BCC Final Microproject

The document outlines a railway reservation system project implemented in C++. It includes an index, introduction, class diagram, implementation code across 10 pages, output screenshots across 4 pages, and conclusion and reference sections. The project uses object-oriented concepts like inheritance and polymorphism to develop a console-based application for railway reservation with features like viewing train schedules, booking and canceling tickets, and an admin module for managing trains and passengers.

Uploaded by

vivekspatil2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views16 pages

BCC Final Microproject

The document outlines a railway reservation system project implemented in C++. It includes an index, introduction, class diagram, implementation code across 10 pages, output screenshots across 4 pages, and conclusion and reference sections. The project uses object-oriented concepts like inheritance and polymorphism to develop a console-based application for railway reservation with features like viewing train schedules, booking and canceling tickets, and an admin module for managing trains and passengers.

Uploaded by

vivekspatil2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

INDEX

Sr.no Content Pg.no

1 Title of Micro-project 1

2 CO Mapped 1

3 Brief Introduction 1

4 Class Diagram 2

5 Implementation of Code 3-10

6 Output(Screen Shots of Output) 11-14

7 Conclusion 15

8 Reference 15
1. Title of Micro-Project:
Develop Railway Reservation System Application.

2. Course Outcomes :

The purpose of the project entitled as “RAILWAY RESERVATION SYSTEM”is to


computize the system railway reservation and details software which is user friendly
simple,fast and cost-effective.
a. Develop C++ to solve problems using OOP.
b. Develop C++ programs using class and objects .
c. Implement concepts like inheritance ,polymorphism etc.

3. Introduction:
C++ is one of the most used and popular programming languages.C++ is used in making
operating systems, embedded systems, and Graphical User Interfaces.

It is an object-oriented programming language that implements all the OOPs concepts such as
Abstraction, Encapsulation, and Inheritance, which gives a clear structure to programs and
allows code to be reused, lowering development costs and providing security.It is portable and
can be used to create applications that can be adapted to multiple platforms.C++ is easy to learn
so that you can choose it as your first programming language.It makes programming easy for
programmers to switch to C++ because its syntax is similar to C, Java, and C#.

The C++ micro-project on RAILWAY RESERVATION SYSTEM is a console


based a application that was written in C++ programming language . In this source code for
railway reservation system in C++, the operations related to both of these modes are very
similar. You can build a detail database, add details, show details, perform user management
functions, and view passenger information in Admin mode. To add and display t rain
inquiry and reservation records, this railway reservation system project in C++
with output has two modes, password protection, and some basic file handling
operations. This railway t icket reservation system project in C++ is finished and
error- free, and I’ve presented the source code in an easy to understand format.
4. Class Diagram

Class Railway

Class Ticket

Class train_info Class admin_info

Class Person
5.Project Code :

#include<iostream.h>

#include<conio.h>

#include<stdlib.h>

#include<stdio.h>

class railway

{public:

char name[20];

int mobile,age;

char gender[10];

int tno,date,i;

void viewinfo();

void choice();

};

class ticket:public railway

public:

void bookticket();

void cancleticket();

};

class train_info

int time;

char tname[20];
};

class admin_info

public:

int password;

char add_name[20];

};

class person:public train_info,public admin_info

public:

void admin();

void viewpassenger();

void deltrain();

void addtrain();

};

void main()

clrscr();

railway r;

cout<<"******************** WELCOME TO RAILWAY RESERVATION SYSTEM


********************"<<endl;

cout<<endl<<"1.View Information";

cout<<endl<<"2.Book Ticket";

cout<<endl<<"3.Cancel Ticket";

cout<<endl<<"4.Admin";
cout<<endl<<"5.Exit"<<endl;

r.choice();

getch();

void railway::choice()

{ int choice1;

ticket t1;

person p;

while(1)

cout<<endl<<"Enter your choice";

cin>>choice1;

switch(choice1)

case 1: railway::viewinfo();

break;

case 2:

t1.bookticket();

break;

case 3:

t1.cancleticket();

break;

case 4:p.admin();

break;

case 5:exit(0);
break;

void railway :: viewinfo()

cout<<endl<<"sr.no Train Name Timing Destination "<<endl;

cout<<" 1 Rajdhani Express 7:00 am Kolhapur"<<endl;

cout<<" 2 Maharaja Express 8:00 am Satara"<<endl;

cout<<" 3 Royal Rajasthan 7:30 am Rajasthan"<<endl;

cout<<" 4 Garib Rath 9:50 am Delhi"<<endl;

cout<<" 5 Golden Chariot 10:40 am Mumbai"<<endl;

void ticket:: bookticket()

{char name[20];

int mobile,age,tno,date,i;

char gender[10];

cout<<endl<<"For Booking Ticket fill necessary information"<<endl;

cout<<"Enter Name: ";

cin>>name;

cout<<"Enter mobile number";

cin>>mobile;

cout<<"Enter age:";

cin>>age;

cout<<"Enter gender(M/F):";
cin>>gender;

cout<<"Enter train number";

cin>>tno;

cout<<"Enter date you want to book";

cin>>date;

cout<<endl<<"<<<<<<Train booked Successfully>>>>>";

void ticket:: cancleticket()

{int pid,phno,otp;

cout<<"Enter Passenger Id: ";

cin>>pid;

cout<<"Enter phone number: " ;

cin>>phno;

cout<<"Enter received OTP: ";

cout<<otp;

cout<<endl<<"soon you will received your refund";

cout<<endl<<"<<<<<<Train cancelled successfully>>>>>>";

void person:: admin()

{ int ch;

person p1;

cout<<"Enter password";

cin>>password;

if(password==12345)
{

cout<<"<<<<<<<<<< Welcome Admin >>>>>>>>>>";

else

cout<<"Password is wrong";

main();

cout<<endl<<" 1.View Passenger"<<endl<<" 2.Add Train"<<endl<<" 3.Delete Train";

cout<<endl<<" 4.Exit";

while(1)

cout<<endl<<"Enter choice";

cin>>ch;

switch(ch)

{ case 1:p1.viewpassenger();

break;

case 2:p1.addtrain();

break;

case 3:p1.deltrain();

break;

case 4:exit(0);

break;

default: cout<<endl<<" wrong choice";

break;
}

void person :: viewpassenger()

cout<<endl<<" sr.no Passenger Name PID Train No. Date";

cout<<endl<<" ";

cout<<endl<<" 1 Alfiya Shekh T1.101 R1234 08/09/23";

cout<<endl<<" 2 Manali Powar T5.120 R9806 10/12/23";

cout<<endl<<" 3 Pallavi Kore T0.67 R1634 11/05/24";

cout<<endl<<" 5 Shreya Thorat T9.103 R1234 08/09/23";

void person::addtrain()

{int tno,date,time;

char dname[20];

cout<<endl<<"1.Enter train number";

cout<<endl<<"2.Enter date of train";

cout<<endl<<"3.Enter timing of train";

cout<<endl<<"4.Enter name of driver";

cin>>tno>>date>>time>>dname;

cout<<endl<<"<<<<<<TRAIN ADDED SUCCESSFULLY>>>>>>";

void person:: deltrain()

{ int tno,date,time;

char dname[20];
cout<<endl<<"1.Enter train number";

cout<<endl<<"2.Enter date of train";

cout<<endl<<"3.Enter timing of train";

cout<<endl<<"4.Enter name of driver";

cin>>tno>>date>>time>>dname;

cout<<endl<<"<<<<<<TRAIN DELETED SUCCESSFULLY>>>>>>";

}
5.Outputs of the program:
1)

2)
3)

4)
5)

6)
7)
7. Conclusion:

In the project Railway Reservation System we have stored all the information about the trains
scheduled and the users booking tickets and even status of train ,seats. This project is useful for
the applications which facilitate passengers to book the train tickets and check status from their
place itself ,it avoids inconviniences of going to railway station for each and every query they
may get.

8. References:

https://github.com/features/code-reviews

You might also like