Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 4, No. 2, 2023 36 Design and Implementation of a C++Based Hotel Management System Wei Chen, Xiangyu Chen College of Applied Science and Technology of Beijing Union University, Beijing, China Abstract: In this paper, we use C++ as the development language and QT to design and develop a hotel management system for the current development of the hotel industry. The system adopts the B/S model to connect the object with the database, so that it has better flexibility and reusability. Its functional modules mainly include customer service module, front-end processing module, back-end management module, data storage module and other parts, which mainly realize the hotel customer's reservation, check-in and check-out and the management of the hotel internal staff and other functions. The development cost of the system is low and the operation is simple, which reduces the learning cost of the staff, improves the management efficiency of the hotel and facilitates the maintenance and management at a later stage. Keywords: Hotel Management System; C++; Functional Modules; Database. 1. Introduction With the development of the times, the application of computers in hotel management has been extended to various departments, and the hotel management system has become an important tool for modern hotel management. Through the computer system to deal with things in the hotel, it has solved the drawbacks of manual management, reduced labor costs and time costs, and improved management efficiency. At present, part of the hotel management system is still C/S architecture, each terminal needs a client, [1] resulting in low processing efficiency, equipment maintenance trouble, increasing the user's difficulty of use. In this paper, we design and adopt a hotel management system based on B/S architecture, which can effectively manage the information of the hotel, reduce the maintenance cost of the hotel, and then improve the profitability of the hotel and increase the overall competitiveness of the hotel. The system development uses MySQL database for data storage, MySQL++ as API for linking, and Microsoft Visual Studio 2019 combined with QT for windows side development. 2. System Overview 2.1. System Requirements Analysis The design of the C++-based hotel management system is oriented to the hotel's internal staff and the hotel's customers. In order to facilitate the use of users, the system should be designed to be relatively simple, easy to understand operation, and reduce the learning cost of staff and customers in order to achieve high efficiency. The system needs to realize the internal management of the hotel and the customer-oriented part respectively, and the hotel's staff information and customer information are not interchangeable. In the client side, the main functions of the system include room reservation, check-in service, departure settlement, etc. In the staff side, the main functions of the system include work arrangement, authority management, staff application, etc. After the system design is completed, daily maintenance personnel need to be retained to ensure the normal operation of the system. 2.2. System Function Analysis The system will be mainly divided into two parts, one for customers and one for hotel staff. The customer-oriented part mainly realizes the functions of hotel information view, room reservation, information registration, room service, departure settlement, hotel contact and hotel evaluation, etc.; the hotel staff-oriented part mainly realizes the functions of staff information registration, work arrangement, staff application, etc. After logging into the system, customers can view and book the hotel. The hotel information module contains the basic information of the hotel, so that customers can see the location, appearance, contact phone number, user evaluation and other basic information of the hotel on the cell phone; the room reservation module allows customers to see the specific information of the room, including the room type, size, lighting condition, location and other information, and at the same time, they can book the room type they want, and subsequently they can also unsubscribe from the rooms already booked; the information Registration module is the basic information that customers need to fill in when booking a room, including customer name, ID number, contact information, length of stay, arrival time, number of people staying, etc., so that it is convenient to confirm with the front desk when arriving at the hotel; room service module is the service that customers can choose after staying at the hotel, this module contains the relevant services in the room, such as TV screen casting, breakfast delivery, take-away, etc. Services, through the choice can be made to the hotel service personnel for service; departure settlement module allows customers to leave the hotel at anytime, anywhere, without waiting for the hotel settlement, refund deposits and other operations can be achieved directly under this function, saving time; contact the hotel and evaluation of the hotel module means that users can contact the hotel before and after the stay for consultation, to understand the relevant information, or after leaving the hotel are to the hotel's service and environment, etc. for evaluation. After the employee’s log in the system, they need to use different functions according to different authority. The information registration module of hotel staff needs to register 37 the staff's name, age, work number, ID number, origin, position and system authority, etc. All hotel staff need to be registered. Ordinary employees can check their current schedule, sign in and clock out, and make applications to the management, etc. The employee application function is mainly used for employees' leave and shift transfer applications. Front desk staff can register and confirm customers' information at check-in, give feedback to customers' room reservation, help call service staff or maintenance staff, check and update hotel room information, respond to customers' service requests after check-in, and help settle accounts after customers leave the hotel, record customers' opinions and comments, etc. according to the rights assigned by the administrator. Managers such as the hotel manager can check the basic information of employees, review the application of employees, check the operation of the hotel, make work arrangement for other employees, review the financial situation, check the customer information, modify the room information, check the evaluation of the hotel by the customers who have stayed in the hotel, etc. after logging into the system. If an employee takes a leave of absence, other employees can be drawn to fill the missing position in time, and at the same time, some relevant information about special offers can be released. The system administrator has all the rights of the system, but can only use it after getting the authorization from the hotel management, and is only responsible for maintaining the normal operation of the system on a daily basis. Hotel Management System Clients Hotel Staff B o o k a h o t e l R e g i s t r a t i o n I n f o r m a t i o n E v a l u a t i o n Employees Front Desk Staff Administra tors C h e c k - i n V i e w R o o m C h e c k o u t R o o m S e r v i c e D a i l y c l e a n i n g M a i n t e n a n c e e q u i p m e n t M e a l d e l i v e r y s e r v i c e A u d i t I n f o r m a t i o n O r g a n i z a t i o n o f w o r k M o d i f y i n f o r m a t i o n System Administrator S y s t e m M a i n t e n a n c e S y s t e m C o n f i g u r a t i o n U p d a t e S y s t e m C h e c k o u t Figure 1. System Structure and Function Diagram 3. System Design 3.1. Design of Classes C++ is an object-oriented programming language, and classes are a very important concept in C++, which is the basis for implementing object-oriented programming. A C++ program of a certain size is made up of many classes. In the process of writing class definition, functions and variables should be named according to their meanings and functions, not just any names. According to the top-down programming principles, the class definitions are written according to the plan. The following is the design of the specific relevant classes in the program. [2] The hotel management system as a whole needs the following classes, permission class includes customer class, administrator class, front desk staff class and general staff class, permission class is mainly through different permissions to distinguish between staff and customers, as well as the functions between various employees; information class includes room information, customer information, staff information, hotel information, etc., which is mainly used to store relevant information, combined with the previous permission class, so that people with different permissions can access different information. The staff class is the base class, the administrator class inherits all its permissions, while controlling other permission classes, has the right to manage and control them, modify other staff permissions, can read and modify all the information in the information class of the information, which, the system administrator generally uses its own permissions, which is mainly responsible for the daily maintenance of the system. The front desk staff class contains the general staff class, which can notify the users when they need it, so that the staff of corresponding functions can meet the needs of customers, such as daily cleaning and maintenance work, while the front desk can view the corresponding customer information, room information, and can modify this information. The general staff class mainly completes the work arrangement from the manager, and can also make application to the manager. 3.2. Database Design Clients Reservation Room Employees Check in Submit Orders Audit Management Management Administrators Management N M N N M M 1 1 1 N 1 N Management N M Figure 2. Hotel Management ER Chart The database is the data support for the system and the data that comes into the system is put into the database for storage. By analyzing the above E-R diagram, the system requirements for the database can be derived, and the logical structure of the database can be further determined, and the logical structure model of the database can be further determined from the above E-R diagram, [3] to derive the database information tables required by the system, mainly including customer information table, staff information table, room information table, hotel information table, etc. The database tables and their field contents need to be established, specifically including: (1) hotel room information table: generally including room number, room type, check-in price, related preferential activities, supporting facilities, number of occupants, check-in time, check-out time, current status of rooms, etc.; (2) room reservation order table: record the customer's reservation information for the hotel room, such as the reserved room number, expected check-in date (2) room reservation order form: record the customer's reservation information for the hotel room, such as the reservation room number, expected check-in date, reservation time, length of stay, number of occupants, number of rooms reserved, contact information, name and ID number, etc.; (3) occupant information form: generally include the name, contact information, ID number, etc., used to store the actual occupant information; (4) order form: include order number, accommodation consumption amount, accommodation 38 deposit, consumption of room items during the stay, number of occupants, occupancy (5) order statistics table: including order number, room usage, room type, etc.; (6) consumption details table: including order number, settlement time, consumption details, consumption total, check-out personnel, etc.; (7) system user information table: user ID, account number, name, contact information, ID, etc., account number, name, contact information, ID number, user points, user check-in history, historical orders, etc.; (8) hotel personnel information table: employee ID, work number, name, login account, gender, age, contact information, position, system rights, department, etc.; (9) hotel employee application form: employee name, work number, application content, etc.; (10) system rights assignment table: user type, user rights. Customer information table includes: name, contact information, document type, document number, room number, length of stay, stay time, comments and other parts. Customer name is generally 2-4 Chinese characters, using varchar type, a Chinese character needs three bytes, so set its length to 12; contact information is generally 11 digits cell phone number, so set it to the length of 11 varchar type; document type is Chinese characters, there are a variety of types, so set it to the length of 128 varchar type; document number is generally The ID number is usually 18 Arabic digits, so set it as a varchar of length 18; the length of stay is from a certain day to a certain day, so its data type is datetime; the check-in time refers to a certain day and a certain time when the customer checks in, so its type is datetime; the note refers to the note information left by the customer when booking the room, so set it as a varchar of length 128; The user priority is decided according to the customer's consumption in the hotel, and its data type is set to int with a length of 5, which is used to identify whether the customer can enjoy priority service and personalized service. Other information tables are designed in the same way. [4] After analyzing the ER relationship diagram, the basic structure of the database tables can be constructed, and three main tables are selected in this section for structural design demonstration. 4. Function Implementation 4.1. Account Function Design Implementation After entering the system interface, the system will provide a login entrance, the system adopts a unified login interface, the user can choose to login or register after entering the login interface, follow the corresponding button prompts to complete the login operation, after entering the account password, the system will verify, if correct, then enter the operation interface, if wrong, there will be a "username or password error " prompt. Both employees and hotel customers have to log in from the same interface, but you can choose whether to log in as a customer or an employee through different options, and you will enter different operation interfaces after logging in with different identities. The customer interface allows you to choose to view information about the hotel and to make room reservations, while the employee login allows you to choose to view the current work schedule, make requests and other operations. 4.2. Implementation of Scheduled Functions After logging into the system, customers can use the room reservation function through the navigation bar of the system. After selecting the corresponding room in the interface, input the corresponding information according to the prompt of the system, such as the expected time of stay, the number of days of stay, the number of people staying, the reservation information, contact information, room information, etc. The system will generate the order after the customer fills in the relevant information, and if there is key information not filled in, then the system will prompt the customer and help him/her to improve the information. After the user confirms that the information is correct and clicks to submit the order, the reservation of the hotel room will be completed, and then the system will send the relevant order information and customer information to the relevant personnel of the hotel for review and confirmation. After the hotel completes the confirmation and ensures that the room is successfully reserved, feedback information will be sent back to the customer through the system for secondary confirmation, thus completing the entire booking process. After the reservation is completed, the customer can check the relevant order information in the personal center, make changes to the relevant information, or cancel the outstanding order. 4.3. Implementation of Front-end Functional Modules The front desk function module can realize the functions of customer information registration, verification, room reservation, remote reception and self-service departure settlement through the Internet, in addition to updating the status of hotel rooms, reporting maintenance, and summarizing related reports. After a customer has made a reservation, the front desk of the hotel needs to respond by confirming the current status of the reserved room, reserving the room, generating a report, and providing feedback to the customer. [5] After helping the customer to complete the reservation, the relevant information is stored in the system so that the management can view it. When a customer books a room, the front desk staff can see the customer's priority level and provide priority service or better personalized service according to the customer's level to improve the customer's stay experience. 4.4. Implementation of Backend Functional Modules The back-end part of the system is mainly provided for the hotel staff to use, which is divided into general staff, front desk administrator, system administrator and hotel management, distinguished according to the different positions and permissions. In order to simplify the design of the system, all employees use a unified operation interface, but since each employee has different permissions, different navigation bars are set up according to different permissions, so that employees with different permissions can complete their corresponding work. The part of ordinary employees mainly realizes the operations of viewing and modifying their own information, viewing the current work arrangement, making applications to their superiors, submitting customer feedback, etc. The administrator can use all the functions in the system, to process, check and approve the financial related information, manage the users of the system, view and reply to the customer's comments, approve the applications submitted by the employees, and complete the management of the rooms, including modifying the information of the rooms and setting the corresponding special offers. The system administrator has the highest authority of the system and can change the authority of other accounts, which is mainly responsible for the daily maintenance of the system, 39 so the administrator authority is generally not used. 5. System Functionality Testing After completing the design of the hotel management system, it is necessary to conduct corresponding functional and performance tests on the system. These include system interaction test, stability test, corresponding ability test and security test, etc. The relevant tests all need to simulate the operation of front desk staff, administrators, customers and other personnel. During the test, it was found that there were some conflicts in the authority of some classes and the authority was not clear enough, after which the problem was solved by redefining the classes and solving the conflicts between some statements. From the overall test results, the system's functionality and related performance could meet the expected requirements and no further problems occurred. 6. Conclusion The article completed the development of the chain hotel management system based on C++ in windows environment, combined with the practical work, the design and development of the hotel management system was explored, the basic functional requirements of the hotel management system was explored, the customer service module, front-end processing module, back-end management module, data storage module and several other parts were designed and implemented, the specific development practice of the main functional modules was carried out, and the testing work of the relevant functional modules was completed, the results showed that the functions in the system run stably, the operation is relatively simple, the efficiency of the hotel management system was improved, and it has a strong practical role. References [1] Dong Huajun.Design and implementation of hotel management system [J].Industrial Control Computer,2022,35(01):140-141. [2] Dai Lujun,Liu Zhanfeng.Design and implementation of elevator simulation program based on C++[J].Computer Development and Applications,2014,27(03):40-42+45. [3] Qian Chunxia.Research on the design of hotel chain management system[J]. Electronic Technology and Software Engineering, 2022,No.229(11):216-219. [4] Xu Xiaoya,Li Junfang.Database design for SQL Server database performance optimization analysis[J].Information and Computer(Theory Edition),2017(02):177-179+185. [5] Liu Cong.Design and research of hotel management system[J]. Electronic Technology and Software Engineering, 2021(01): 165-166.