In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use C++ to achieve hotel management system, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to know about it.
Nowadays, most hotels provide a variety of services of different styles and sizes, but in the final analysis, the two indispensable modules are customers and staff. Due to the lack of a deep understanding of the hotel industry, the system design, including database and functional modules, is simply imitated and implemented on the basis of materials collected online and personal cognition.
In order to meet the actual needs of hotel management, the system mainly implements the following functions:
1. Check-in: check-in room number, check-in time, check-out time, personal information (ID card number, mobile phone number, name)
2. Check out: enter the room number you have checked in, and you can check out after confirmation.
3. Room query: the administrator can query the room status and specific check-in information after entering the correct password.
4. Password modification: the administrator modifies his own password, only if the correct password is entered first.
5. Store information data in the form of txt documents.
6. Use class encapsulation.
Note: before using the code, you need to store information in the Input.txt document under the custom path in the code.
Function screenshot
Code:
# include#include#include#include#include#include#include # includeusing namespace std;class room {private: int roomnumber = 0; / / Room number int price = 0; / / Price int start_date = 0; / / start and end date int end_date = 0; bool order = 0; / / Room status 0Uniple 1 string name / / personal information string ID; string phone;public: void getnumber (int _ number) {roomnumber = _ number;} int returnnumber () const {return roomnumber;} void getprice (int _ price) {price = _ price;} int returnprice () const {returnprice } void getdate (int s, int e) {if (s)
< 1 || s >31 | | e
< 1 || e >31 | | s > = e) throw runtime_error ("wrong date!"); start_date = s; end_date = e;} int returnstartdate () const {returnstart _ date;} int returnenddate () const {returnend _ date } void getorder (bool _ order) {if (! (_ order = = 0 | | _ order = = 1) throw out_of_range ("Room status error!"); order = _ order;} bool returnorder () const {returnorder;} void getname (string _ name) {name = _ name;} string returnname () const {returnname } void getID (string id) {if (id.size ()
< 18 || id.size() >19) throw runtime_error ("your ID number is entered incorrectly, please re-enter it! (18 digits)"); ID = id;} string returnID () const {returnID;} void getphone (string ph) {if (ph.size ()! = 11) throw runtime_error ("your mobile phone number is entered incorrectly, please re-enter (11 digits)!") Phone = ph;} string returnphone () const {returnphone;} int sumprice () {return price * (end_date-start_date);} friend ostream& operator
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.