Skip to content

sidhant-khamankar/Railway-Reservation-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

College-OOP-PBL - Railway Reservation System

OOP Subject Project Based Learning Github: https://github.com/sidhant-khamankar/Railway-Reservation-System

Topic: Railway Reservation System

Description: This program will allow admin to generate user ids ,set Train info and see all Reservations, users and cancellations. User can Reserve, Enquire and Cancel Ticket. Ticket fare will be calculated based upon concession category. Every data will be written to files in binary form using file Handling. Updation of Seats after reservation and cancellation takes place as well. PNR is generated randomly using random function.

Flowchart Links

main database user

database  manage

User Reserve and Enquire: https://app.code2flow.com/RAF4yK3bkvCR

Reservation enquire

User cancel

Classes:

Train:

Contains Train Details like name, number, class type and their fares, date, boarding and destination stations. It has function for inputting these details and printing them.

Reserve:

Contains Passenger details like name, age and the corresponding booked train details along with PNR number, concession, reserved seats. It has function for inputting these details and printing them.

Cancel:

Similar to Reserve class.

User:

Contains id and password of user. It has function for inputting these details and printing them.

Functions

Admin:

It has subfunctions to Add Train, Display all trains and following functions

User Management:

It can be used to add new Users and display existing users with their ID and password.

Display Reservations:

It reads records from Reservation file and display them.

Display Cancellations:

It reads records from Cancelled file and display them.

User:

A particular user can login using his/her credentials. It has following subfunctions

Reserve:

It takes ticket details from user as input. Calculates concession and updates seats in Train file and then generates PNR Number using random number generator.

Cancel:

It takes PNR number as input and finds the reserved ticket and deletes it from Reservation file and Updates Cancellation file.

Enquiry:

Display all Trains Details from Train file.

Files

id.txt:

Binary file. Contains User Records.

t.txt:

Binary file. Contains Train Records.

p.txt:

Binary file. Contains Reservation Records.

cn.txt:

Binary file. Contains Cancellation Records.

temp.txt:

Binary file. Holds Reservation Records except Cancellation Records.

Output

Admin Adds Trains

admin add trains

Admin display trains

admin display trains

Admin adds and displays users

admin user add and display

User Reserves

user reserv_1 user reserv_2

User Enquires after Reservation

user enquiry after reservation

Admin displays all reservations

admin display reservations

User cancels reservation

user cancel

Admin displays all cancellations

admin display cancellations

Applications

We can use a similar system for bus, airline reservations, theatre ticket booking and Library Management i.e It will be used wherever there is need of booking or reserving.

Conclusion

We learnt to implement Object Oriented Programming Concepts like Encapsulation and Abstraction and File Handling Concept in this project.