Software feature:- 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 l
Trang 1FACULTY OF INFORMATION TECHNOLOGY
FINAL TERM PROJECT Course name: Data Structures and Algorithms
DESIGN DATA STRUCTURES, ALGORITHMS AND BUILD A HOTEL
22110048 Nguyen Hoang Lam 100%
22110060 Nguyen Tan Phat 100%
22110080 Ly Dang Trieu 100%
Ho Chi Minh City, December 2023
Trang 2LIST OF MEMBER
Class: Monday – Lesson 9-12
Note:
- Contribution (%) = 100%: Percentage level of each student participating
- Leader: Nguyen Tan Phat
_ Lecturer note:
December … , 2023 Lecturer Signature
Hoang Van Dung
No Student ID Student Name Contribution
(%)
Trang 3To 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 overcomeour 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 10Nguyen Hoang LamNguyen Tan Phat
Ly Dang Trieu
Trang 4Figure list 5
Table list
A HEADING
1 Reason for choosing topic
2 Software feature
3 Expected interface
4 Plan emplementation
4.1 Planning
4.2 Division
B CONTENT
1 Project descriptions
2 Background knowledges
2.1 Programming method
2.2 Linked list
2.3 Multi-Linked list
C CODING SESION
1 Coding
1.1 Struct
1.2 Operation function
1.2.1 For manager
1.2.2 For staff
1.2.3 For room
2 Test/Experimental results and discussions
2.1 Main menu
2.2 Login as manager
2.3 Login as guard
Trang 52.4 Login as receptionist
2.5 Login as service staff
D CONCLUSION
1 Conclusions
2 Future development
REFERENCES
Trang 6FIGURE LIST
2.1 Linked list presentation
2.1 Multi-Linked list presentation
Trang 7TABLE LIST
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
Trang 83.2.20 View staff information
3.2.21 Receptionist menu display
3.2.22 Room management menu display3.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 show3.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
Trang 9A HEADING
1 Reason for choosing topic:
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
2 Software feature:
- 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
3 Expected interface:
- Menu to choose which position to login as (manager, accountant, security…)
- Login console (Type ID, Pasword)
+ To caculate revenue and expenditure
- Service staff interface
+ Guest can use the service so that the income will increase
Trang 10Code, write an asingment, make presentation,
fix code bugs
Nguyen Hoang Lam Design view level
Design logical levelWrite codeWrite assignment
100%
Nguyen Tan Phat Design view level
Make diagramWrite codeWriting assingment
100%
Ly Dang Trieu Design logical level
Write codeDesign and fix bugsMake presentation
100%1.2 Task division table
Trang 11B CONTENT
1 Project descriptions:
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 login console such as account, password, information, salary
- The manager such as edit manager list, edit every staff list and check the hotel
income
- The receptionist such as rent room, book room, reserve room, show all room
- The service staff such as using the service
- Rooms such as ID, type, status, day begin, day end, money
2 Background knowledge:
2.1 Programming method:
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++
2.2 Linked list:
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
Trang 12Linked 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
Trang 14NodeGD* temp = new NodeGD{ username, password, head };
Trang 15head = temp;
total++;
}//Add manager to the last of the listvoid 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) move = move->next;
move->next = temp;
} total++;
}// Add manager to position pos of the listvoid addItem(int pos, const string& username, const string& password) {
if (pos <= 0) { addFirst(username, password);
} else if (pos >= total) { addLast(username, password);
} else { NodeGD* temp = new NodeGD{ username, password, nullptr };
NodeGD* move = head;
for (int i = 0; i < pos - 1; i++) { move = move->next;
} temp->next = move->next;
move->next = temp;
total++;
} }
Trang 16NodeGD* current = head;
for (int i = 0; i < pos - 1; i++) {
//Read data from manager text file
bool ReadFileToLinkedList(LinkedListGD& GiamDocList) { ifstream ifs;
string username, password;
if (iss >> username >> password) {
Trang 33If 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 displayThen 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
Trang 34And 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
Trang 353.2.12 Hotel income display
If we choose to edit the staff information, the display of some options are different fromthe rest while editing the manager Take the security staff for an example:
3.2.13 Edit staff display
Trang 36Unlike adding a manager, adding a staff require to input the ID, name, password, address, age, gender, day joined
3.2.14 Add new staff displayAnd with the deleting a staff you will have to input the ID and the name of the staff
3.2.15 Delete staff displayAfter 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
Trang 373.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
Trang 383.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
2.3 Login as guard:
If we login as a guard or as other staffs there is alway have an option, it is view the user information
Trang 393.2.20 View staff information
2.4 Login as receptionist:
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
Trang 403.2.23 All rooms list display
3.2.24 All booked rooms display
Trang 413.2.25 All rented rooms display
Trang 42Now if we choose to check-in a customer the software show the list of the rooms thoseare 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 displayAnd 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
Trang 433.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
Trang 443.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
Trang 45And the last option is reset the room just to clear all of the room data
3.2.30 Reset room display
2.5 Login as service staff:
If we login as service staff there are 2 options such as view your information and create service for customer
Trang 463.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
Trang 473.2.33 Service used display
Trang 48D CONCLUSION
1 Conclusions:
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
Pros:
- 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
2 Future development:
- Optimize data when running the software
- Add the rented history for every room, upgrade the calculator so that it can calculate the money for a room in difficult conditions
- Add more features to the function so that the input would be more logical
Trang 491 Lecture note Data Structures and Algorithms course, chapter 2,3
2 Giao diện phần mềm EzCloudhotel