Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (3.11 MB, 49 trang )
<span class="text_page_counter">Trang 1</span><div class="page_container" data-page="1">
<b>FACULTY OF INFORMATION TECHNOLOGY</b>
<b>FINAL TERM PROJECT Course name: Data Structures and Algorithms</b>
<b>DESIGN DATA STRUCTURES, ALGORITHMS AND BUILD A HOTEL</b>
22110048 Nguyen Hoang Lam 100% 22110060 Nguyen Tan Phat 100% 22110080 Ly Dang Trieu 100%
<i>Ho Chi Minh City, December 2023</i>
</div><span class="text_page_counter">Trang 2</span><div class="page_container" data-page="2"><b>Class: Monday – Lesson 9-12</b>
- Contribution (%) = 100%: Percentage level of each student participating - Leader: Nguyen Tan Phat
Hoang Van Dung
<b>No.Student IDStudent Name<sup>Contribution</sup>(%)</b>
</div><span class="text_page_counter">Trang 3</span><div class="page_container" data-page="3">To fully adapt this topic and report, we would like to express our sincere thanks to lecturer, associate professor Hoang Van Dung, who directly supported us throughout the process of working on the topic. We appreciate you for guiding us to complete this topic, always answer questions and provide timely comments and corrections, help us overcome our shortcomings and complete it on time.
We finished the topic and report in a short period of time, with lack of knowledge and experience in implementing a software project. Therefore, there will be some unpredictable mising from us, so we look forward to receive comments from you so that we can do better for our next projects.
Finally, we respectfully wish all teachers good health and success in the career of cultivating people. Once again we sincerely thank you.
Ho Chi Minh City, December 2023 Group 10
Nguyen Hoang Lam Nguyen Tan Phat Ly Dang Trieu
</div><span class="text_page_counter">Trang 6</span><div class="page_container" data-page="6">2.1. Linked list presentation 2.1. Multi-Linked list presentation
</div><span class="text_page_counter">Trang 7</span><div class="page_container" data-page="7">1.1. Planning table 1.2. Task division table 3.1.1. Struct table
3.1.2. Manager function table 3.1.3. Staff function table 3.1.4. Room function table 3.2.1. Main menu display 3.2.2. Manager text file 3.2.3. Manager login display 3.2.4. Manager options display 3.2.5. Edit manager display 3.2.6. Read manager data display 3.2.7. Add manager display 3.2.8. Remove manager display 3.2.9. Manager list display 3.2.10. Write manager file display 3.2.11. Save file checker 3.2.12. Hotel income display 3.2.13. Edit staff display 3.2.14. Add new staff display 3.2.15. Delete staff display 3.2.16. Sort list by ID 3.2.17. Load the staff display 3.2.18. Save the staff display 3.2.19. Save file checker
</div><span class="text_page_counter">Trang 8</span><div class="page_container" data-page="8">3.2.20. View staff information 3.2.21. Receptionist menu display 3.2.22. Room management menu display 3.2.23. All rooms list display
3.2.24. All booked rooms display 3.2.25. All rented rooms display 3.2.26. Check-in display
3.2.27. Check-in successfully show 3.2.28. Reserve room display 3.2.29. Check-out room display 3.2.30. Reset room display 3.2.31. Service staff menu display 3.2.32. Services menu display 3.2.33. Service used display
</div><span class="text_page_counter">Trang 9</span><div class="page_container" data-page="9"><b>1. Reason for choosing topic:</b>
Technology plays a huge role in our everyday lives. It has also become integrated into the daily operations of hotel management. By leveraging the latest technologies, businesses can streamline operations, increase efficiency, and improve customer service. This helps to reduce costs, increase revenue, and ensure long-term profitability. Therefore, our group decided to choose the topic which to design data structures, algorithms and build a hotel management software. Applying technology to hotel management help user to optimize the amount of manual management on paper that waste lots of time, narrow storage space, avoid losing data, reduce costs and human resources, so that improve work efficiency and product quality.
<b>2. Software feature:</b>
- To login as a staff in a hotel - Can manage the hotel as a manager
- Update information (ID, Name, Password, Address, Age, Gender, Day Joined) - Update room ( )
Decide to let the guest rent, book or return the room or not - Caculate income
<b>3. Expected interface:</b>
- Menu to choose which position to login as (manager, accountant, security…) - Login console (Type ID, Pasword)
- Manager interface
+ Can hire or fired the staff, can search for other staff ìnormation - Receptionist interface
+ Can see the room status (rented/booked/empty) so that decide to let the guest rent or book the room
- Accountant interface
+ To caculate revenue and expenditure - Service staff interface
+ Guest can use the service so that the income will increase
</div><span class="text_page_counter">Trang 10</span><div class="page_container" data-page="10">Code, write an asingment, make presentation, fix code bugs
Nguyen Hoang Lam Design view level Design logical level
</div><span class="text_page_counter">Trang 11</span><div class="page_container" data-page="11"><b>1. Project descriptions:</b>
A hotel need to manage and control the people who work in the hotel and arrange all the rooms in the hotel, so that it needs to have a software to manage the manager, the accountant, the receptionist, the service staff and rooms including these information:
- All the staffs and managers at <b>login console </b>such as account, password, information, salary
<b>-The manager such as edit manager list, edit every staff list and check the hotel </b>
<b>-The receptionist such as rent room, book room, reserve room, show all room-The service staff such as using the service</b>
<b>-Rooms such as ID, type, status, day begin, day end, money</b>
<b>2. Background knowledge:2.1.Programming method:</b>
Data Structures and Algorithmsin introduce abstract concepts for data organization and manipulation, to show how these concepts are useful in problem solving.
- Basic – used data structures: Lists, Stacks, Queues, Trees, Hash tables. - Algorithms in data structures: Sorting, searching, inserting, deleting. - Apply data structures to solve practical problems
- Programming language: C++
<b>2.2.Linked list:</b>
Linked list is using a structure which allows to store elements in a list A linked list is made of nodes that are pointing to each other - Link: each link of linked list can store data called an element
- Next: every link of linked list store a link to the next element called Next - Head: a linked list such as links link to first element called Head
2.1. Linked list presentation
</div><span class="text_page_counter">Trang 12</span><div class="page_container" data-page="12">Linked list’s basic functions:
- Insertion: insert an item at the beginning, at the end, after a node - Removing: delete an item at the beginning, at the end, after a node - Searching: Search a node in a list
<b>2.3. Multi-Linked list:</b>
- Inserting into this structure is very much like inserting the same node into two separate lists. In multi-linked lists it is quite common to have back-pointers
2.2. Multi-Linked list presentation
</div><span class="text_page_counter">Trang 13</span><div class="page_container" data-page="13">//Add manager to the front of the list
void addFirst(string username, string password) {
</div><span class="text_page_counter">Trang 14</span><div class="page_container" data-page="14">NodeGD* temp = new NodeGD{ username, password, head };
</div><span class="text_page_counter">Trang 15</span><div class="page_container" data-page="15">head = temp; total++; }
//Add manager to the last of the list
void addLast(string username, string password) {
NodeGD* temp = new NodeGD{ username, password, nullptr }; if (head == nullptr)
head = temp; else {
NodeGD* move = head; while (move->next != nullptr)
// Add manager to position pos of the list
void addItem(int pos, const string& username, const string&
NodeGD* move = head; for (int i = 0; i < pos - 1; i++) {
//Delete manager at position pos void deleteItem(int pos) { if (pos < 0 || pos >= total) {
cout << "Invalid position for deletion" << endl; return;
</div><span class="text_page_counter">Trang 16</span><div class="page_container" data-page="16">NodeGD* current = head; for (int i = 0; i < pos - 1; i++) {
//Read data from manager text file
bool ReadFileToLinkedList(LinkedListGD& GiamDocList) { string username, password; if (iss >> username >> password) {
</div><span class="text_page_counter">Trang 33</span><div class="page_container" data-page="33">If we want to add a manager, we have to input the new manager’s name and a password for the account too
3.2.7. Add manager display
If we want to remove a manager, we just need to type the manager’s name and confirm the deletion
3.2.8. Remove manager display
Then we can display all the manager to check the manager list if it has changed like what we did
3.2.9. Manager list display
</div><span class="text_page_counter">Trang 34</span><div class="page_container" data-page="34">And to save all the data of the manager we have edited we will overwrite it into the manager text file
3.2.10. Write manager file display
To ensure that user want to save this file to the text, we include the checker in order to make sure that the user won’t forget to save their files
3.2.11. Save file checker
If we choose to see the income it will show the money of all the room that we have gain before
</div><span class="text_page_counter">Trang 35</span><div class="page_container" data-page="35">3.2.12. Hotel income display
If we choose to edit the staff information, the display of some options are different from the rest while editing the manager. Take the security staff for an example:
3.2.13. Edit staff display
</div><span class="text_page_counter">Trang 36</span><div class="page_container" data-page="36">Unlike adding a manager, adding a staff require to input the ID, name, password, address, age, gender, day joined
3.2.14. Add new staff display
And with the deleting a staff you will have to input the ID and the name of the staff
3.2.15. Delete staff display
After we add some more staff the list would be a mess, but we could sort the list again by the ID, if the list is sorted by ID already it will notify that
</div><span class="text_page_counter">Trang 37</span><div class="page_container" data-page="37">3.2.16. Sort list by ID
We add a checker to check whether the user want to load or not
3.2.17. Load the staff display This is the same with the previous but for the written one
</div><span class="text_page_counter">Trang 38</span><div class="page_container" data-page="38">3.2.18. Save the staff display
And to ensure that user want to save this file to the text, we include the checker in order to make sure that the user won’t forget to save their files
3.2.19. Save file checker
<b>2.3.Login as guard:</b>
If we login as a guard or as other staffs there is alway have an option, it is view the user information.
</div><span class="text_page_counter">Trang 39</span><div class="page_container" data-page="39">3.2.20. View staff information
<b>2.4.Login as receptionist:</b>
If we login as a receptionist, there are 2 options such as view your information and manage rooms
3.2.21. Receptionist menu display
When we choose to manage rooms, there are 7 options such as check-in a customer, reserve a room, view all rooms, view all booked rooms, view all rented rooms, check-out a customer and reset the room
3.2.22. Room management menu display We can choose to view all the room, view all booked or rented rooms
</div><span class="text_page_counter">Trang 40</span><div class="page_container" data-page="40">3.2.23. All rooms list display
3.2.24. All booked rooms display
</div><span class="text_page_counter">Trang 41</span><div class="page_container" data-page="41">3.2.25. All rented rooms display
</div><span class="text_page_counter">Trang 42</span><div class="page_container" data-page="42">Now if we choose to check-in a customer the software show the list of the rooms those are empty and ask to input the ID of the room, after we choose a room it’s status will change to rented and the day begin change to today
3.2.26. Check-in display
And the room status will be changed to rented and the day begin will set to today and the money will be updated 5 dollars for single room and 7 dollars for double room respectively
</div><span class="text_page_counter">Trang 43</span><div class="page_container" data-page="43">3.2.27. Check-in successfully show
Beside that, if the guest want to reserve a room the software will show the list of the empty room and we have to input room ID, reservation date, number of day(s) for the reservation and confirm it. If the reservation date is in the past it will force you to type again.
</div><span class="text_page_counter">Trang 44</span><div class="page_container" data-page="44">3.2.28. Reserve room display
If we choose to check-out, the software will display the rented room list, then we can choose the room that need to check out and it will calculate the payment and show it
3.2.29. Check-out room display
</div><span class="text_page_counter">Trang 45</span><div class="page_container" data-page="45">And the last option is reset the room just to clear all of the room data
3.2.30. Reset room display
<b>2.5.Login as service staff:</b>
If we login as service staff there are 2 options such as view your information and create service for customer
</div><span class="text_page_counter">Trang 46</span><div class="page_container" data-page="46">3.2.31. Service staff menu display
When we choose to creat service, the software will show the service menu display with 6 options such as room service, special occasion services, tech support, culinary experiences, communication services, personal shopping services
3.2.32. Services menu display
Those option are the same when we choose an option there are a menu which has more options for the services, and when you choose an option the payment that room has to pay will update. For an example with the first option
</div><span class="text_page_counter">Trang 47</span><div class="page_container" data-page="47">3.2.33. Service used display
</div><span class="text_page_counter">Trang 48</span><div class="page_container" data-page="48">Our group has solved most of the basic requirements have been set. Beside that, we added some useful features for the software such as login console, staff and manager information editing.
- The display is clearly that every user can easily appraoch - The data is well organized that can be finded quickly - The code working well and show the right result Cons:
- Few features are not working logically - Some functions are not fully automated
<b>2. Future development:</b>
<b>-</b> Optimize data when running the software
<b>-</b> Add the rented history for every room, upgrade the calculator so that it can calculate the money for a room in difficult conditions
<b>-</b> Add more features to the function so that the input would be more logical
</div><span class="text_page_counter">Trang 49</span><div class="page_container" data-page="49">1. Lecture note Data Structures and Algorithms course, chapter 2,3 2. Giao diện phần mềm EzCloudhotel
</div>