Hostel Booking System Project in C++ with Source Code

Hostel Booking System Project in C++ with Source Code

The Hostel Booking System Project in C++ is a consoled based application and created using C++ programming language. This system is a simple mini project and compiled in Code::Blocks IDE using GCC compiler. This Hostel Booking System Project is primarily based totally at the idea of booking rooms and storing room information. The framework contains just the administrator side. Here, the administrator can carry out all the task like booking rooms, showing the status of rooms, dropping the booking, and modifying the booking. Likewise, there’s no login framework for this project system.

This simple mini project for Hostel Booking System Project in C++ is complete and totally error free and  also includes a downloadable Source Code for free, just find the downloadable source code below and click to start downloading. Before you start to click the download now first you must click the Run Quick Scan for secure Download.

This Hostel Booking System Project in C++ framework depends on an idea to store all the records of the room’s status and their appointments. Likewise, this program is considered as a straightforward information base of room status where the administrator can store room records and their booking records effectively as it isn’t tedious. Additionally, the client can reserve new spot and furthermore drop reservations according to their desire.

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 2022.

To start creating a Hostel Booking System Project in C++, make sure that you have a Code Blocks or any platform of C++ installed in your computer.

Steps on how to create a Bank Management System Project in C++

Hostel Booking System Project in C++ with Source Code

  • Step 1: Create a new project.

    First open the code blocks IDE and click “create a new project“.Click Create New Project inHostel Booking System in C++ with Source Code

  • Step 2: Choose console application.

    Second click the “console application” and after that click “next“.

  • Step 3: Choose C++ language.

    Third choose “C++ language” and click “next“.

  • Step 4: Name Your Project.

    Fourth name the project you’ve created and click “next” after that click “finish“.Project Title for Hostel Booking System project in C++ with Source Code

  • Step 5: The actual code.

    You are free to copy the given source code below or download the downloadable source code given.

This function is for the main menu

In the code given below, which is for the function for the main features of the system which is you can choose the choice if you want to book a room for 1 person, book a room for 2 person, book a room for 3 person, Display current status of rooms , modify, and cancel a booking.(Hostel Booking System Project in C++)

int main()
{
hostel objectives; int key_rooms; char channels; int checking_floors; objectives.create(); do { cout << "\n1.Book a room for 1 person\n2.Book a room for 2person\n3.Book a room for 3 person\n4.Display the current status of rooms\n5.cancel a booking\n6.modify"<< endl; cout << " Enter your choice : " ; cin >> key_rooms;

This function is for the display of all rooms

In the code given below, which is for the function to display all the rooms available or not available.(Hostel Booking System Project in C++)

void display()
{
int y = 0, z = 0, w = 0;
for (int x = 0; x < 48; x++) { cout << "--"; } cout << "\n " ; for (int x = 1; x < 4; x++) { cout << "| Floor number : "<< x << " \t\t"; } cout << "|\n" ; for (int x = 0; x < 48; x++) { cout << "--"; } WORDS = TITLE[y]; HSTL *s = TITLE[y + 1]; HSTL *t = TITLE[y + 2]; cout << "\n "; while (WORDS != NULL) { if (WORDS->fill != WORDS->NUMBER && WORDS->NUMBER != 0)
{
y++;
cout << "| room no : "<< y; cout << "->Vacant cots->"<< WORDS->NUMBER;
}
else
{
y++;
cout << "| room no : "<< y; cout << "->Present ";
}
if (s->fill != s->NUMBER && s->NUMBER != 0)
{
z++;
cout << "\t | room no : "<< y; cout << "->Vacant cots->"<< s->NUMBER;
}
else
{
z++;
cout << " \t | room no : "<< y; cout << "->Present ";
}
if (t->fill != t->NUMBER && t->NUMBER != 0)
{
w++;
cout << "\t | room no : "<< y; cout << "->Vacant cots->"<< t->NUMBER << "| "; } else { w++; cout << "\t | room no : "<< y; cout << "->Present "<< " | "; } cout << " \n "; for (int x = 0; x < 48; x++) { cout << "--" ; } cout << "\n "; WORDS = WORDS->NXT;
s = s->NXT;
t = t->NXT;
}
}

This function is for the rooms booking

In the code given below, which is for the function for the user to choose a rooms to book. There are 3 choices of bookings such as book a room for 1 person, book a room for 2 person and book a room for 3 person.(Hostel Booking System Project in C++)

void booking(int people)
{
int fl, rom;
cout << "\nEnter the floor number : "; cin >> fl;
try
{
if (fl < 0 || fl > 4)
{ throw(fl); } WORDS = TITLE[fl - 1]; cout << "\nEnter the room number : "; cin >> rom; try { if (rom < 0 || rom > 10) { throw(rom); } else { int x = 1; while (x < rom) { WORDS = WORDS->NXT; x++; } if (WORDS->NUMBER >= people) { cout << "\nroom is vacant you can apply for room" ; int count = 0; while (WORDS->fill - 1 <= WORDS->NUMBER) { cout << "\nEnter name "<< WORDS -> fill + 1 << " : "; cin >> WORDS->CUS_NAMES[WORDS->fill]; count++; WORDS->fill++; if (count >= people) { break; } } WORDS->NUMBER = WORDS->NUMBER - people; } else { cout << "\nroom is not vacant... SORRY !!!"; } } } catch (int r) { cout << "\ninvalid room number : "<< r; } } catch (int r) { cout << " \ninvalid floor number : " << r; } }

This function is to cancel a booking

In the code given below, which is for the function to cancel a booking of user who wants to cancel their booking.(Hostel Booking System Project in C++)

void cancelled(int check)
{
char checking_namess[10];
int fg = 0;
int rms, x = 1;
try
{
if (check < 0 || check > 4)
{ throw(check); } else { cout << " Enter the room no : "; cin >> rms; try { if (rms < 0 || rms > 10) { throw(rms); } else { cout << " Enter the name to be delete :"; cin >> checking_namess; WORDS = TITLE[check - 1]; while (x < rms) { WORDS = WORDS->NXT; x++; } x = 0; while (x < 3) { if (!strcmp(checking_namess, WORDS -> CUS_NAMES[x])) { fg = 1; break; x = 0; } else x++; } if (fg == 1 && WORDS->fill != 0) { cout << "\nrecord deleted : "<< WORDS -> CUS_NAMES[x]; WORDS->CUS_NAMES[x][0] ='A'; WORDS->CUS_NAMES[x][1] ='\0'; WORDS->fill--; WORDS->NUMBER++; } else cout << "\nrecord not present "; } } catch (int r) { cout << "\ninvalid room number : " << r; } } } catch (int r) { cout << " \n floor dosn't exist : " << r; } }

This function is for the update of bookings

In the code given below, which is for the function to update the users booking.(Hostel Booking System Project in C++)

void modify(int check)
{
char checking_namess[10];
int rms, x = 1;
try
{
if (check < 0 || check > 4)
{ throw(check); } else { cout << " Enter the room no : "; cin >> rms; try { if (rms < 0 || rms > 10) { throw(rms); } else { cout << "Enter the name to be updated :"; cin >> checking_namess; WORDS = TITLE[check - 1]; while (x < rms) { WORDS = WORDS->NXT; x++; } x = 0; while (x < 3) { if (!strcmp(checking_namess, WORDS -> CUS_NAMES[x])) { cout << "\nenter updated name : " ; cin >> WORDS->CUS_NAMES[x]; break; } else x++; } if (x >= 3) cout << "record not found "; else { cout << "\nrecord updated\nprevious name : "<< checking_namess << "\nupdated name : "<< WORDS->CUS_NAMES[x]; } } } catch (int r) { cout << "\ninvalid room number : "<< r; } } } catch (int r) { cout << "\n floor dosn't exist : "<< r; } }
};
ABOUT PROJECTPROJECT DETAILS
Project Name :Hostel Booking 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:September 26, 2020 – 5:41 am
Hostel Booking System Project in C++ with Source Code Information

Downloadable Source Code

Summary

In summary, this 2022 Hostel Booking System Project in C++ project can be useful to students or professional who wants to learn C++ programming language. This project can also be modified to fit your personal requirements. Hope this project will help you to improve your skills.

That’s how you create Hostel Booking System Project in C++ with Source Code in your projects. You can always expand and try different ways in implementing the Hostel Booking System Project in C++ in your C++ projects. In this Mini Project for Hostel Booking System Project in C++ with Source Code is free to download and It is easy to understand and manipulate this project and use for education purpose only.

Inquiries

If you have any questions or suggestions about Hostel Booking System Project in C++ with Source Code, please feel free to leave a comment below.

Leave a Comment