Hotel Management System Project Using C++ Language
Last updated Jan 24, 2022In this project, we will see how to build the HOTEL MANAGEMENT SYSTEM project using C++ programming language.
INTRODUCTION:
It covers macros, classes, objects, arrays, functions, loops, and structure in this project for C++ novices. When this code is launched, the user is presented with a menu with seven options numbered 1 through 7, after which the program executes according to the user's choices. The output from the g++ compiler may be seen at the bottom of this page.
The following are the project's main features:
-
Manage rooms: In this project we can manage how much rooms available or booked .
-
Guest Check-In & Check-Out: Using this project we can monitor the guest check-in or check-Out activities with time.
-
Get available rooms: We can get all available rooms.
-
Search customer: Using this we can search any customer or guest, is he/she still available in hotel or not.
-
Get guest summary report: We will get the summary details of guest using this project.
Tools Used using project:
I used Dev C++ IDE or you can use any IDE which is suitable to you.
Implementation of Hotel Management System:
Step 1. Create a new Project in Dev C++
File > New > Source File or Ctrl + N |
Step 2. First of all we will include all header file which will use in project.
#include |
Step 3. Add the following line below header file:
using namespace std; |
The using namespace statement simply implies that in the scope in which it is present, all items in the std namespace are available without needing to prefix them with std:
Step 4. Now we will create a class(customer) which can take the details of the customer
class Customer |
Step 5. Now we will create a class(room) which can take the details of the room.
class Room class Customer cust; |
Step 6. Now we will create function to add room, search room and display room
class Room rooms[max];
cout<<"\n Room Added Successfully!";
void Room::displayRoom(Room tempRoom) |
Step 7. Now we will create class(hotel management) which include these function:
1. Checkin
2. getAvailRoom
3. searchCustomer
4. checkout
5. guestSummaryReport
class HotelMgnt:protected Room
if(count==0){ getch(); |
1. Check-in : check all the customer detail like booking id: name, address, advance payment, from date, to date.
void HotelMgnt::checkIn() class Room room; cout<<"\nEnter booking id: "; cout<<"\nEnter Customer Name (First Name): "; cout<<"\nEnter Address (only city): "; cout<<"\nEnter Phone: "; cout<<"\nEnter From Date: "; cout<<"\nEnter to Date: ";
rooms[i].status=1; cout<<"\n Customer Checked-in Successfully.."; |
2. getAvailRoom : It shows all the available room in hotel.
void HotelMgnt::getAvailRoom() |
3. Search customer: It shows all persons that have booked room.
void HotelMgnt::searchCustomer(char *pname) cout<<"\n\nPress enter for next record"; |
4. Checkout: It generates the bill of the expenses and remaining payment of the customer.
void HotelMgnt::checkOut(int roomNum) cout<<"\n\t######## CheckOut Details ########\n"; rooms[i].status=0; |
5. GuestSummaryReport: It gives the detail of customer.
void HotelMgnt::guestSummaryReport(){ if(count==0){ getch(); |
Step 8. Here we can see the main menu of the project and Use the switch statement to select one of many code blocks to be executed.
void manageRooms()
|
Step9. finally we create main funtion it is a special function is the primary function. A function called main is required in every C++ application. It acts as the program's starting point. The computer will begin running the code from the main function's beginning.
int main() system("cls"); do switch(opt) getch(); |
OUTPUT:
Main Screen:
![]() |
Manage Rooms:
![]() |
Add Room:
![]() |
Search Room:
![]() |
Checkin Screen:
![]() |
Available Rooms:
![]() |
Search Customer:
![]() |
Check-Out Screen:
![]() |
Guest Summary Screen:
![]() |
Conclusion: In this project, we have covered how to build Hotel Management System Project and manage information of rooms, guests etc.. using C++ programming language.
Article Contributed By :
|
|
|
|
9156 Views |