INTRODUCTION
The project, Hotel Management System is a web-based application that allows
the hotel manager to handle all hotel activities online. Interactive GUI and the
ability to manage various hotel bookings and rooms make this system very flexible
and convenient. The hotel manager is a very busy person and does not have the
time to sit and manage the entire activities manually on paper. This application
gives him the power and flexibility to manage the entire system from a single
online system. Hotel management project provides room booking, staff
management and other necessary hotel management features. The system allows
the manager to post available rooms in the system. Customers can view and book
room online. Admin has the power of either approving or disapproving the
customer’s booking request. Other hotel services can also be viewed by the
customers and can book them too. The system is hence useful for both customers
and managers to portable manage the hotel activities.
Advantages
• Sometime it happens that the rooms get booked soon when one visits
the place therefore user can make advance booking using this system.
• It saves user time in searching a room.
• The system is useful as it calculates an exact cost of rooms for requested
number of days.
• It saves organization resources and expenses.
• This system is effective and saves time and cost of users.
Disadvantages
• The booking process usually requires a customer identity, which the
system cannot detect.
• It requires a reliable internet connection
Program for hotel management application
#include <iostream>
#include <vector>
#include <string>
class HotelRoom {
public:
HotelRoom(int roomNumber, bool isOccupied, double rate)
: roomNumber(roomNumber), isOccupied(isOccupied),
rate(rate) {}
int getRoomNumber() const { return roomNumber; }
bool getIsOccupied() const { return isOccupied; }
double getRate() const { return rate; }
void bookRoom() { isOccupied = true; }
void checkoutRoom() { isOccupied = false; }
private:
int roomNumber;
bool isOccupied;
double rate;
};
class Hotel {
public:
Hotel(const std::string& name) : name(name) {}
void addRoom(int roomNumber, double rate) {
rooms.push_back(HotelRoom(roomNumber, false, rate));
}
void displayRooms() {
std::cout << "Rooms at " << name << ":\n";
for (const HotelRoom& room : rooms) {
std::cout << "Room " << room.getRoomNumber() << ": ";
if (room.getIsOccupied()) {
std::cout << "Occupied\n";
} else {
std::cout << "Available (Rate: $" << room.getRate() <<
"/night)\n";
}
}
}
void bookRoom(int roomNumber) {
for (HotelRoom& room : rooms) {
if (room.getRoomNumber() == roomNumber) {
if (!room.getIsOccupied()) {
room.bookRoom();
std::cout << "Room " << roomNumber << " booked
successfully.\n";
} else {
std::cout << "Room " << roomNumber << " is already
occupied.\n";
}
return;
}
}
std::cout << "Room " << roomNumber << " not found.\n";
}
void checkoutRoom(int roomNumber) {
for (HotelRoom& room : rooms) {
if (room.getRoomNumber() == roomNumber) {
if (room.getIsOccupied()) {
room.checkoutRoom();
std::cout << "Room " << roomNumber << " checked
out successfully.\n";
} else {
std::cout << "Room " << roomNumber << " is not
occupied.\n";
}
return;
}
}
std::cout << "Room " << roomNumber << " not found.\n";
}
private:
std::string name;
std::vector<HotelRoom> rooms;
};
int main() {
Hotel myHotel("Sample Hotel");
myHotel.addRoom(101, 100.0);
myHotel.addRoom(102, 120.0);
myHotel.addRoom(103, 150.0);
int choice;
do {
std::cout << "\nOptions:\n";
std::cout << "1. Display available rooms\n";
std::cout << "2. Book a room\n";
std::cout << "3. Check out of a room\n";
std::cout << "4. Exit\n";
std::cout << "Enter your choice: ";
std::cin >> choice;
switch (choice) {
case 1:
myHotel.displayRooms();
break;
case 2:
int roomToBook;
std::cout << "Enter room number to book: ";
std::cin >> roomToBook;
myHotel.bookRoom(roomToBook);
break;
case 3:
int roomToCheckout;
std::cout << "Enter room number to check out: ";
std::cin >> roomToCheckout;
myHotel.checkoutRoom(roomToCheckout);
break;
case 4:
std::cout << "Exiting...\n";
break;
default:
std::cout << "Invalid choice. Try again.\n";
}
} while (choice != 4);
return 0;
}
Outputs
Conclusion
In conclusion, a hotel management application
offers numerous benefits to hotel owners and staff,
as well as guests. By streamlining hotel operations,
enhancing the guest experience, improving
communication, managing finances, and storing and
managing guest data, this software enables hotel
managers to focus on providing excellent service to
their guests. In today’s competitive hospitality
industry, implementing a hotel management system
can give hotels a competitive edge and help them
provide an exceptional guest experience