Railway Reservation System in C with Source Code
This Railway Reservation System Project in C Language is developed using C programming language. The aim of this system To develop a safe and efficient railway reservation and administration system, as well as a search system for trains and passenger information, to assign seats to passengers on the waiting list, and to construct a login system for securing passenger booking information.
By building a safe and speedier railway reservation and search system for trains and passenger details, this project intends to improve the railway administration system, which will be valuable for both authorities and passengers.
This project’s scope is much broader than an engineering endeavor. This might be implemented in a real-world railway management system to allow for faster data access and better waiting management. This strategy can also be used to other modes of transportation.
The program’s complexity must be considerably raised in order to retain the dates and times of travel. Each train must have a distinct instance of it for each day. The database will grow in size as a result, and the application will need to be updated to reflect the system calendar. This level of sophistication was not feasible for this project, so the trains were instead classified as everyday trains.
Anyway if you want level up your knowledge in programming especially C/C++ Programming Language, try this new article I’ve made for you Best C Projects with Source Code for Beginners Free Download 2020.
To run this Railway Reservation System in C make sure that you have a Code Blocks or any platform of C installed in your computer. Please scroll down and click the download button to obtain a free copy of the Railway Reservation System project.
ABOUT PROJECT | PROJECT DETAILS |
---|---|
Project Name : | Railway Reservation System |
Project Platform : | C/C++ |
Programming Language Used: | C Programming Language |
Developer Name : | itsourcecode.com |
IDE Tool (Recommended): | Dev-C++/Codeblocks |
Project Type : | Desktop Application |
Database: | Stores data in .DAT file |
Upload Date and Time: | July 27, 2021- 9:04 am |
Railway Reservation System in C Steps On How To Run The Project
Time needed: 5 minutes.
Here’s the step’s on how to run a Railway Reservation System in C with Source Code.
- Step 1: Extract file.
Next, after you finished download the source code, extract the zip file.
- Step 2: Open CodeBlocks
After that, After extracting the zip file, open your “CodeBlocks IDE”.
- Step 3: Open Project.
Then, open file tab and Open File after that open folder RRS-IN-C then click the “main“.
- Step 4: Run Project
Lastly, Open build tab and select build and run or you can use key F9.
- Step 5: The actual code.
Finally, You are free to copy the given source code below or download the downloadable source code given.
This Railway Reservation System in C was build and run under Code::Blocks IDE.
- Function to create main menu in the system.
void mainmenu(char user[20],char pw[20]){ char choice; check=0; retry: system("cls"); printf("\n\t\t WELCOME, %s.\n",user); printf("\n\t\t|\t CHOOSE WHAT TO DO\t\t\t |"); printf("\n\t\t|\t _______________________________\t |"); printf("\n\t\t|\t| 1. Book new tickets\t\t|\t |"); printf("\n\t\t|\t| 2. Cancel booked trips\t|\t |"); printf("\n\t\t|\t| 3. Check upcoming travels\t|\t |"); printf("\n\t\t|\t| 4. Check waitlist\t\t|\t |"); printf("\n\t\t|\t| 5. Logout\t\t |\t |");
- Function to create a sign up.
void signup(){ char user[20],pw[20],c; char dir[100]="./railway dbs/"; int len,ch,i; FILE *fptr; redouser: strcpy(dir,"./railway dbs/"); ch=0; system("cls"); printf("\n\t\t __________________________"); printf("\n\t\t|\t\t\t |"); printf("\n\t\t|\t SIGN UP\t |"); printf("\n\t\t|__________________________|"); printf("\n\n\t\tNOTE : Username should consist of 6-16 characters\n\t\t [Only numbers and alphabets without space]"); printf("\n\n\t\tUSERNAME : "); scanf("\n"); scanf("%[^\n]%*c",user); len=strlen(user); if(len>16 || len<6) { printf("\n\t\tWARNING : Username does not follow conditions. Retry.");
- The function to start up main window
void startup(){ char choice; system("cls"); system("color 1F"); printf("\n\t\t\t WELCOME TO MANILA TRAIN RAILWAY SERVICE\n\n"); printf("\n\n\t\tPress any to continue...... "); getch(); redo: system("cls"); printf("\n\t\t\t CHOOSE YOUR OPTION\t\t\t "); printf("\n\t\t\t 1. Login to Existing Account\t\t"); printf("\n\t\t\t 2. Create New Account\t\t"); printf("\n\t\t\t3. Exit\t\t "); choice=getch(); if(choice!='1'&&choice!='2'&&choice!='3') { printf("\n\t\tWarning : INVALID INPUT. TRY AGAIN\n"); delay(1); goto redo; } else { if(choice=='1') login(); else if(choice=='2') signup(); else if(choice=='3') shutdown(); } }
- Function to search new booking
int* search(char user[20],char pw[20],int c){ int choice,origin,dest,n_trains,i,*lst,*index=malloc(3*sizeof(int)); char option,ch; if(c==0){ redo_origin : system("cls"); printf("\n\t\t\t NEW BOOKING\t"); printf("\n\n\t\t NOTE : Choose Where you wish to travel from.\n"); display_stations(); printf("\n\t\t CHOICE : "); scanf("%d",&choice); if(choice<=0 || choice>34){ printf("\n\t\t WARNING : INVALID OPTION. RETRY."); delay(1); goto redo_origin; }
- Function to check up coming travels.
void check_upcoming(char user[20],char pw[20]){ FILE *in; char dir[100]="./railway dbs/",ps[20]; struct passenger p; int i=0; strcat(dir,user);strcat(dir,".txt"); in = fopen(dir,"r"); system("cls"); printf("\n\t\t| UPCOMING TRAVELS\t |"); fscanf(in,"%s ",&ps);
- The function to check waiting list.
void check_waitlist(char user[20],char pw[20]){ FILE *in; char dir[100]="./railway dbs/",ps[20]; struct passenger p; int i=0; strcat(dir,user);strcat(dir,".txt"); in = fopen(dir,"r"); system("cls"); printf("\n\t\t|\tWAITING LIST\t |"); fscanf(in,"%s ",&ps);
- Function to cancel booking.
void cancelbooking(char user[20],char pw[20]){ FILE *in,*out; char dir[100]="./railway dbs/",ps[20],c,dir2[100]; struct passenger p,r; struct waitlist *t,*s; int i=0,n,index; strcat(dir,user);strcat(dir,".txt"); redoview: i=0; in = fopen(dir,"r"); system("cls"); printf("\n\t\t|\tCANCEL BOOKING\t |"); fscanf(in,"%s",&ps);
Downloadable Source Code
Conclusion
This Railway Reservation System in C with Source Code is only a project made for school requirement purposes only. A Railway Reservation System in C language was created specifically for a semester project. It aims to give beginners a good understanding of programming small to large projects by imparting general workable and practical information about C. You can download this program and modify it to suit your client requirements, since this is a student project it means you cannot really expect 100% functionality from this.
Related Articles
- Simple Hospital Management System In C With Source Code
- Employee Management System In C With Source Code
- Hotel Management System Project In C With Source Code
- School Billing System in C with Source Code
- Bank Management System in C with Source Code
- ATM Machine C Program With Source Code
- Department Store Management System Project in C with Source Code
- Library Management System In C With Source Code
- Student Record System in C with Source Code
- Medical Store Management System In C With Source Code
- Tourism Management System Project in C with Source Code
- Bookshop Management System Project In C With Source Code
- Prison Management System Project in C with Source Code
- Tic Tac Toe In C Programming With Source Code
- Customer Billing System C Project With Source Code
- Snake Game In C Programming With Source Code
- Bus Reservation System Project In C Language With Source Code
- Snakes And Ladders Game In C Language With Source Code
- Pacman Game In C With Source Code
- Employee Record Management System in C with Source Code
- Contact Management System in C with Source Code
- Car Rental System in C with Source Code
- Stock Management System Project in C with Source Code
- Airline Reservation System Project In C With Source Code
- Gym Management System In C With Source Code
- Hangman Game In C With Source Code
- Inventory Management System Project in C Language with Source Code
- Student Attendance Management System in C Language w/ Source Code
- Student Management System in C with Source Code
- Payroll Management System in C Language with Source Code
- Food Ordering Management System in C with Source Code
- Clothing Store Management System Project in C with Source Code
- Quiz Game in C with Source Code
- Guessing Game in C Programming with Source Code
- Student Database Management System in C with Source Code
- Pizza Ordering System in C Language with Source Code
- Mobile Shop Management System Project in C Language w/ Source Code
- Canteen Management System Project in C Language with Source Code
- College Management System Project in C Language with Source Code
Other Articles you might read also:
- Best Final Year Project for Computer Science 2021
- Best Thesis Title For IT/CS Student [Updated 2021]
- How to Make An Effective Thesis or Capstone Document
- Writing A Good Research Title For Thesis or Capstone Project
- ICHS Library Management System
- College Management System Project in Django with Source Code
- Search Filter In Django With Source Code
- Best Python Course Online | Python Course Free 2021
- ECOMMERCE IN JAVASCRIPT FRAMEWORK WITH SOURCE CODE
- To Do List Project in Python with Source Code | Video | 2020
Inquiries
If you have any questions or suggestions about Railway Reservation System in C Source Code, please feel free to leave a comment below.