0% found this document useful (0 votes)
228 views43 pages

TDS2111

The document describes a student project to develop an online restaurant reservation system. It includes: 1) An introduction describing the increasing popularity of dining at restaurants and the need for digital reservation systems. 2) Sections on ADT specification, implementation details, program screenshots, and a table of contents that will be included in the final report. 3) Details of the tasks completed by each group member and their signatures. The project aims to create a digital reservation system for a restaurant to make reservations easier for customers and help restaurants manage reservations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
228 views43 pages

TDS2111

The document describes a student project to develop an online restaurant reservation system. It includes: 1) An introduction describing the increasing popularity of dining at restaurants and the need for digital reservation systems. 2) Sections on ADT specification, implementation details, program screenshots, and a table of contents that will be included in the final report. 3) Details of the tasks completed by each group member and their signatures. The project aims to create a digital reservation system for a restaurant to make reservations easier for customers and help restaurants manage reservations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

TDS 2111 DATA STRUCTURES AND ALGORITHMS

FACULTY OF INFORMATION SCIENCE AND TECHNOLOGY

TDS 2111 DATA STRUCTURES AND ALGORITHMS

TUTOR:
MR. TIMILEHIN ADERINOLA

PROJECT TITLE:
RESTAURANT ONLINE RESERVATION SYSTEM

NO STUDENT NAME STUDENT ID


1 PENDY TOK 1181101110
2 GRACE NG YEE LIN 1171103531
3 NGWE JIA LE 1181101714
4 PHUAH WAY LYNN 1181303521

1
TDS 2111 DATA STRUCTURES AND ALGORITHMS

2
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Project Evaluation Sheet


This form is to appended to the final report for submission.

Online Restaurant Reservation System


by
Pendy Tok

%
A. Final Report 7 Remark
i. Introduction / Problem Statements /1
/2 Draft
ii. ADT Specification
/1 Final
iii. Implementation Details
– Justification for each data structure chosen, e.g., why do you
consider the stack data structure, but not queue?
/2
– Justification for each algorithm chosen, e.g., why do you
implement binary search, rather than other searching
algorithms?
iv. Program Screenshots
/1
v. Implementation Codes (in a CD)
B. Program Source Code 11
i. Basic functionalities, including add, edit, delete, search, sort,
display
/5
– No compilation/run-time errors
– File handling, usability, user friendliness
ii. Data Structures
– Any two data structures learned in TDS2111, including
linked-list, stack, queue, hash tables, etc. /2
– Array implementation is acceptable, but there will be no
mark given in this section.
iii. Good Programming Practices
– Code readability and cleanliness, consistent indentation
– Commendation and documentation /2
– Self-explanatory naming convention for variables and
function names
iv. Extras
– Self-defined header files, separate files for classes, exception
/2
handling, aesthetic design
– Additional functionalities, etc.
C. Program Demonstration 2
Question and Answer /2
Total / 20

3
TDS 2111 DATA STRUCTURES AND ALGORITHMS

4
TDS 2111 DATA STRUCTURES AND ALGORITHMS

5
TDS 2111 DATA STRUCTURES AND ALGORITHMS

6
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Task Declaration Form


Each group member, including the group leader, must individually complete and sign this form.
The signed forms (from all members) are to be appended to the final report for submission.

Online Restaurant Reservation System


by
Pendy Tok

Group Member’s Name :

Group Member’s ID :

For the purpose of completing this project, I have performed the following tasks:

1. I hereby declare that I have assessed the final submission and I take the full responsibility should there be
any incompleteness, omissions, delays, or non-submission.

2. I also certify that not part of this project is copied from any other student’s work, or from any other
sources, except where acknowledgement is made.

Group Member’s Signature :

Group Member’s Name :

Group Member’s ID :

7
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Date :

8
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Task Declaration Form


Each group member, including the group leader, must individually complete and sign this form.
The signed forms (from all members) are to be appended to the final report for submission.

Online Restaurant Reservation System


by
Pendy Tok

Group Member’s Name :

Group Member’s ID :

For the purpose of completing this project, I have performed the following tasks :

3. I hereby declare that I have assessed the final submission and I take the full responsibility should there be
any incompleteness, omissions, delays, or non-submission.

4. I also certify that not part of this project is copied from any other student’s work, or from any other
sources, except where acknowledgement is made.

Group Member’s Signature :

Group Member’s Name :

Group Member’s ID :

Date :

9
TDS 2111 DATA STRUCTURES AND ALGORITHMS

10
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Table of Contents
1.0 Introduction 8
2.0 ADT Specification 9
2.1 Draft ADT 9
2.2 Final ADT 13
3.0 Implementation Details 17
3.1 Data Structures Used 17
3.1.1 Singly Linked List 17
3.1.2 Vector 17
3.1.3 Nested Map 18
3.1.4 Stack 18
3.2 Algorithm Used 19
3.2.1 Sequential Search 19
3.2.2 Merge Sort 19
4.0 Program Screenshots 20

11
TDS 2111 DATA STRUCTURES AND ALGORITHMS

1.0 Introduction

With the new thinking of the current society, more people are going to restaurants for dinner
instead of making the food themselves. People started to dine in at restaurants more frequently
than ever. From festivals like New Year and Christmas to anniversaries to a normal gathering, we
have various reasons to have our dinner at a restaurant.

With the increasing popularity of restaurants, reservation quickly become more important than
ever, as many restaurants are not even accepting walk in customers due to full reservations. As
such, a digitalized restaurant reservation is very much needed. An online restaurant reservation
system is very useful for both restaurant owners and customers as it can reduces the restaurant
owners’ burden to accept, record and keep track of all reservations while enables customers to
make a reservation in an easy fashion.

Western Hut’s Online Restaurant Reservation System provides a platform for customers and the
owner to have quick information on the reservations. Customers can make and edit their
reservations by themselves through the system, without needing any extra help from the owner.
Customers only need to sign up their account to start making their reservations. For the owner,
this system can provide a great help as it can provide a list view of all reservations and
customers. Search and sort algorithms are also implemented to help the owner in obtaining
specific records easily. The system also can help the owner in improving the restaurant and the
system as it collects feedbacks from the customers.

12
TDS 2111 DATA STRUCTURES AND ALGORITHMS

2.0 ADT Specification

2.1 Draft ADT

ADT Draft Specifications


Reservation ADT
An abstract class that has TableReservation as child class.

Data Items
● int reservationNo
● int date
● int time

Operations

1. Reservation (int date, int time)


Requirements:
Date and time must be in the future.
Result:
Constructor. Creates a reservation that all the entries have values except reservationNo.

2. ~Reservation ()
Result:
Destructor. Destroys the reservation.

3. virtual void dateAvailability() = 0


Result:
When overloaded by subclass, the output will return the availability of that particular date and time.

4. void setReservationNo ()
Requirements:
ReservationNo are 4 digits number start from 1001 until 1999.
Result:
Set reservation number for every new reservation made.

Person ADT
A struct that groups person(customer) information of mixed data types.

13
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Data Items

● int custID
● string password
● string fullName
● int contactNo
● string email

Operations

1. void getInfo ()
Result:
Return the information of all customers.

2. void editInfo (string n, int c, string e)


Result:
The information of person is updated except unique customer ID.

3. void setCustID ()
Requirements:
custID must be NULL before this, as each customer could only have a unique customer ID. Active
customer is not allowed to reset the customer ID (only applicable to new customer).
Result:
New customer obtains his/her customer ID for further reservation activities.

4. void searchPerson (int custID)


Requirements:
custID must be valid (present in record).
Result:
Display particular record of particular customer.

TableReservation ADT
Child class of Reservation.

Data Items

● int tableNo
● int pplNo
● string reservationType

14
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Operations

1. TableReservation (int date, int time)


Requirements:
Date and time must be in the future.
Result:
Constructor. Creates a reservation that all the entries have values except reservationNo.

2. ~TableReservation ()
Result:
Destructor. Destroys the TableReservation.

3. void dateAvailability ()
Result:
Determine that particular table is available on that time of date or not.

4. void addReservation ()
Requirements:
Date and time must be in future and not allowed to make reservation a day before. Must determine
whether individual or group reservation is needed.
Result:
Creates new reservation. Customer obtains the reservation number, reservationNo.

5. void confirmation (int reservationNo)


Requirements:
reservationNo must be valid (present in record).
Result:
A receipt will be given to each customer for the successful reservation.

6. void deleteReservation (int reservationNo)


Requirements:
reservationNo must be valid (present in record).
Result:
Remove the reservation based on reservation number.

7. void modifyReservation (int reservationNo, int date, int


time)
Requirements:
reservationNo must be valid (present in record). Modified date and time must be in future.
Result:
The particular reservation is updated.

15
TDS 2111 DATA STRUCTURES AND ALGORITHMS

8. void viewAllReservation ()
Result:
Display all the reservation record.

9. void searchReservation ()
Requirements:
reservationNo must be valid (present in record).
Result:
Display particular reservation.

10. void preorder (int reservationNo)


Requirements:
reservationNo must be valid (present in record).
Result:
The preorder food set is added into the particular reservation’s record.

11. void feedback (int reservationNo)


Requirements:
reservationNo must be valid (present in record). Only allow to give feedback after the meal.
Result:
Feedback of customer on restaurant’s service is recorded.

12. void viewFoodMenu()


Result:
Display foods that are available in set and its price for later pre-order.

16
TDS 2111 DATA STRUCTURES AND ALGORITHMS

2.2 Final ADT

Reservation ADT
An abstract class that has TableReservation as child class.

Data Items
● List<Customer>

Operations

1. void load_custList()
Result:
Load all the existed customer records from file into the linked list.

2. void addCust()
Requirements:
No duplicated customer ID is generated for new customer.
Result:
Add new customer and his/her information into the dynamic data structure, linked list.

3. void deleteCust()
Requirements:
The customer ID entered exists in customer record.
Result:
Remove particular customer record from linked list and the file.

4. void sortCust()
Result:
Sort the customers based on customer ID in ascending order or customer name either in ascending
order or descending order.

5. void displayCust()
Result:
Display all customer record.

6. void modifyCust()
Result:
Modify particular customer record.

17
TDS 2111 DATA STRUCTURES AND ALGORITHMS

7. virtual void checkAvailability(int& inputDate, int&


inputTime, int& rTableNo, bool& flag) = 0
Result:
When overloaded by subclass, the function will check the availability of that particular date and
time for reservation.

8. void save_custList()
Result:
Save all the data in dynamic memory into file.

9. Void searchCust()
Result:
Search particular customer and displays his or her information.

Customer ADT
A struct that groups customer information of mixed data types.

Data Items

● int custID
● string custPassword
● string custName
● int custContact
● string custEmail

Operations

1. Customer(string cName, int cID, string cEmail, string


cPassword)
Requirement:
All information of customer such as name, customer ID, email, password needed to be pass into
this parameterized constructor.
Result:
Create a new object Customer which contains the new customer ‘s information.

TableReservation ADT
Child class of Reservation.

18
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Data Items

● int reservTableNo
● int reservPplNo
● string reservType
● int custID
● int reservID
● int reservDate
● int reservTime

Operations

1. TableReservation(int rID, int cID, int rDate, int rTime,


int rTableNo, string rType, int rPplNo)
Requirements:
Date and time must be in the future. All information of reservation needed to be pass into this
parameterized constructor.

Result:
Constructor. Creates a reservation object that all the entries have values.

2. ~TableReservation()
Result:
Destructor. Destroys the TableReservation.

3. void checkAvailability (int& inputDate, int& inputTime,


int& rTableNo, bool& flag)
Result:
Determine that particular table is available on that time of date or not.

4. void addReserv()
Requirements:
Date and time must be in future and not allowed to make reservation a day before. Must determine
whether individual or group reservation is needed.
Result:
Creates new reservation. Customer obtains the reservation ID, reservID.

5. void confirmReserv(int reservID, int custID)


Requirements:
reservID and custID must be valid (present in record).
Result:
A receipt will be given to each customer for the successful reservation.

19
TDS 2111 DATA STRUCTURES AND ALGORITHMS

6. void deleteReserv()
Requirements:
reservID must be valid (present in record).
Result:
Remove the reservation based on reservation number.

7. void modifyReserv()
Requirements:
reservID must be valid (present in record). Modified date and time must be in future.
Result:
The particular reservation is updated.

8. void displayReserv()
Result:
Display all the reservation record.

9. void searchReserv()
Requirements:
reservID must be valid (present in record).
Result:
Display particular reservation.

10. int generate_reservID()


Result:
Generate new reservation ID for each new reservation.

11. void addFeedback()


Requirements:
reservID must be valid (present in record). Only allow to give feedback after using system.
Result:
Feedback of customer on restaurant’s service is recorded.

12. void sortReserv()


Result:
Display reservation record in descending order or date in either ascending or descending order.

13. void set_custID(int cID)


Result:
Set the customer ID to the user input customer ID.

20
TDS 2111 DATA STRUCTURES AND ALGORITHMS

14. void get_reservDate()


Result:
Return date.

15. void load_dateAvailabilityMap()


Result:
Read data from file and load into the nested map.

16. int save_dateAvailabilityMap()


Result:
Write the data from nested map into file.

17. void load_reservList()


Result:
Read data from file and load into the linked list.

18. void save_reservList()


Result:
Write the data from linked list into file.

21
TDS 2111 DATA STRUCTURES AND ALGORITHMS

3.0 Implementation Details

3.1 Data Structures Used

In this project, there are a few of data structures being utilized to ensure the smooth run of
program which are:

● Singly Linked List


● Vector
● Nested Map
● Stack

3.1.1 Singly Linked List

Reservation, a class that organizes all the person information such as name, customer ID,
phone number, and email. In order to ensure the personal information are gathered together,
struct and singly linked list are used to link customer information from one to another. Whether
there is a new customer, the customer’s information into the end of linked list. Any modification
(add/delete/update) on the customer’s data will be carried out on the linked list and save into the
file.

Linked list is selected as the data structure to be used in this case as linked list is a
dynamic data structure that can grow and shrink during run time and provide ease of insertion
and deletion. Compare to array that stores a collection of similar type data elements, linked list is
a non-primitive data structure that contains a collection of unordered linked elements known as
nodes. Time complexity for both array and linked list do not have a huge difference. Other data
structures such queue and stack are totally not suitable here. Therefore, linked list is used.

22
TDS 2111 DATA STRUCTURES AND ALGORITHMS

3.1.2 Vector

Vectors are used in load function in this project as a purpose to store the substrings of the
file and pass the contents of vectors to the dynamic data structures such as linked list for further
data modification. Vector is resizable dynamic array that the size can be determined in O(1) time.
Since the data might grow from time to time, fixed size array is not preferable here. We need not
data structures like hash table, queue, stack or linked list in handling this task so vector is the
best candidate here.

3.1.3 Nested Map

Nested map is a data structure used to store the table count in each date and time. It is mainly
used in void TableReservation::checkAvailability(int& inputDate, int&
inputTime, int& rTableNo, bool& flag), when user adding a reservation. It is chosen
as one of our data structures because we need to map the table count (value) to the combination
of date and time (keys). From Figure 3.1, the outer map stores date as key and inner map as the
value, while the inner map stores time and table count. Since our program needs multiple keys,
hence other data structures are not handy to be used.

Figure 3.1. Nested map declaration (from TableReservation.h)

3.1.4 Stack

Stack is a data structure that follows the first in, last out (FILO) or the last in, first out
(LIFO) order. A stack is used in the sort functions to descend sort the records. It is chosen
because it has the FILO or LIFO nature, which makes it very easy to implement and does not
require too much time to develop another sorting algorithms.

23
TDS 2111 DATA STRUCTURES AND ALGORITHMS

24
TDS 2111 DATA STRUCTURES AND ALGORITHMS

3.2 Algorithm Used

The algorithms used in this program are:

● Sequential search
● Merge sort

3.2.1 Sequential Search

Search functions is used to search customer record and also reservation record. Customer
record is searched using customer ID, while reservation record is searched using reservation
number. Both of the records used linked list data structure. Therefore, sequential search should
be the most suitable searching algorithm to use in our program, as linked lists do not allow
random access of their nodes.

3.2.2 Merge Sort

Sort functions are used to sort customer records and reservation records for the system
admin. Customer records are originally sorted by their Customer ID, in ascending order, while
the reservation records are initially sorted by their Reservation ID, also in ascending order. The
admin can select to sort by Customer ID in descending order, or by Customer Name in both
orders for the customer records. For the reservation record, the admin can select to sort by
Reservation ID in ascending order, or by Date in both orders. All implementation of descending
order sort is done by utilizing the FILO or LIFO nature of a stack, while the ascending order sort
is done by implementing merge sort algorithm.

Merge sort is implemented as it is a divide-and-conquer sorting algorithm, which makes it


more suitable to scaling compared to some of the other sorting algorithms like bubble sort and
selection sort. As linked lists do not allow random access of their nodes, the elements in the
nodes are copied to an array before the sorting process started. This is done to simplify the

25
TDS 2111 DATA STRUCTURES AND ALGORITHMS

process of splitting the array and to have shorter sorting time. The sorted records will be
displayed after the merge sort.

26
TDS 2111 DATA STRUCTURES AND ALGORITHMS

4.0 Program Screenshots

Figure 4.1. Main menu of Western Hut - Online Reservation System


Figure 4.1 shows the main menu of the online reservation system of Western Hut. In the menu
are selections like customer login, customer sign up, admin mode, and exit. Users will be
prompted to enter their choice of selection where 1- customer login, 2- customer sign up, 3-
admin mode, and 0- exit.

Figure 4.2. Customer login


The figure above is the redirection of user from main menu to customer login page. User will be
prompted to enter their customer ID and password to log in the system. The password will be
concealed by using “*” for each character entered. After pressing “Enter”, the password will be
elongated by a few more “*” for security purposes just like in Figure 4.3.

27
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.3. Entering wrong password in customer login


If the user enters the wrong customer ID or password, or the customer ID or password are not
found or do not match, they will be asked to key in their customer ID and password until it is
correct. These are shown in Figure 4.3.

Figure 4.4. Customer sign up


Selection 2 from Main menu which is customer sign up is shown in Figure 4.4. For the selection
of -2- from the main menu, users are directed to this page. They will be prompted to enter their
name, contact number, email, and password. Users also need to confirm their password again.
The password will also be elongated by a few more “*” for security purposes. Users can enter
“0” to go back to the main menu too.

28
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.5. Password confirmation mismatch


Figure 4.5 illustrates the output when there is password confirmation mismatch. When users key
in the password and the confirmation password does not match it, they will receive a message
informing them that the passwords are not the same and they will be asked to key the passwords
in again. If the user continues to key in different passwords, the system will continue to prompt
them to reenter the passwords.

Figure 4.6. Successful sign up


In the figure above, shows the output of a successful sign up of a customer. Users will receive a
message confirming the successful creation of a new account then be directed to the main menu
designated for customers after pressing on any key.

Figure 4.7. Customer main menu


Figure 4.7 shows the customer main menu. Users will be directed here after successful customer
sign up or after they have logged in through customer login. The main menu here has the
selections to make a new reservation, display all reservations, and log out. Users will be
prompted to enter their choice of selection where 1- new reservation, 2- display all reservation,
3- Search reservation, 4- modify reservation, 5- delete reservation, and 0- log out.

29
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.8. New reservation


When users choose selection -1- from the customer main menu which is to make a new
reservation, they will be redirected to this page as shown in Figure 4.8. The user will be
prompted to enter the year, month, and date of reservation, line by line. A selection of time slots
will be shown, and the user will be asked to pick a time slot. Checking for time availability will
be done, and if available, the table will be reserved. Then, user will be asked to input type of
reservation whether it is for a group or an individual, and the number of people. If individual was
picked, the system will skip asking the user to enter the number of people. A message will
inform the user that the reservation is successful, and a receipt will be automatically generated.
Users are also not allowed to make a reservation a day before. If the user attempts to do so the
system will give a message as shown in Figure 4.9 and ask the user to reenter the reservation
details.

Figure 4.9. Message informing users that it is not allowed to make a reservation a day before

30
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.10. Receipt generated after successful reservation


Figure 4.10 shows an example of a receipt generated after a successful reservation is made. The
receipt will contain details inputted by the user previously stored in a text file with a newly
auto-generated filename that will not repeat. The receipt will contain the reservation ID,
customer ID, full name of customer, date and time of reservation, table number, reservation type,
and number of people. The receipt must be closed to continue using the system. After closing,
user exits to customer main menu by pressing any key.

Figure 4.11. User inputs a date in the past


Figure 11 shows an output example when a user inputs a date in the past. If the user prompted to
enter the current year, month, and date enter a date in the past, the system will ask the user to
reenter another date after current date and time that will be shown on the screen.

Figure 4.12. User inputs an invalid month

31
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.12 shows the output when a user inputs an invalid month. User will be prompted to
reenter the month and the system will even provide a range that is from 1 to 12.

Figure 4.13. User inputs a time not in the selection


The figure above, Figure 4.13 shows an example output of user inputting a time not in the
selection. If the time not in the selection is chosen, the system will prompt user to pick a time
that is at “1700, 1800, 1900, 2000, 2100, 2200 or 2300” hours only. If user continues to enter the
wrong time, the system will repeatedly ask user to reenter.

Figure 4.14. Display all reservation


Figure 4.14 shows the page of selection -2- from customer main menu which is to display all
reservations from the current customer ID. The information shown are reservation ID, customer
ID, date, time, table number, reservation type, and number of people.

Figure 4.15. Search Reservation


The figure above, Figure 4.15 shows the Search Reservation selection from the customer main
menu. Users are prompted to key in a reservation ID to search. Users can enter “0” to go back to
the main menu too.

Figure 4.16. Search result


In Figure 4.16, an example of a Search result is shown. The information shown are searched by
reservation ID, and the search results also include customer ID, date, time, table number,

32
TDS 2111 DATA STRUCTURES AND ALGORITHMS

reservation type, and number of people. Pressing any key will return users to the customer main
menu.

Figure 4.17. Searching a record not belonging to the user


Figure 4.17 shows the output when a user searches a record not belonging to him. The search
result will show “ID not found”. Then, users have to go back to the customer main menu to
search again after pressing any key. Users can enter “0” to go back to the main menu too.

Figure 4.18. Modify reservation


The figure above shows the result after selecting modify reservation in customer main menu.
Users are prompted to enter the reservation ID of the reservation they want to modify. The
modify function cancels the reservation made, deletes the receipt file, and jumps to this page as
shown above.

33
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.19. and Figure 4.20. Modify reservation result


Figure 4.19 and Figure 4.20 shows the sample output of modifying the reservation. Users will
need to fill in new information as what they would like to have for their reservation just like
making a new reservation. A new reservation number and a new receipt will be generated for the
user after successful modification of the reservation.

Figure 4.21. Delete reservation


Figure 4.21 shows the delete reservation. Users are prompted to enter the reservation ID of the
reservation they want to delete. A confirmation message will show on screen to let users know
that the deletion of the reservation is successful. Users can enter “0” to go back to the main menu
too.

Figure 4.22. Pop-up after logging out - User feedback

34
TDS 2111 DATA STRUCTURES AND ALGORITHMS

When users log out of their account, a message as shown above in Figure 4.22 will be shown to
users before the log off. Users can choose to answer the feedback by entering yes (y/Y) or skip it
by entering no (n/N). Skipping the user feedback give an output as shown below in Figure 4.23.

Figure 4.23. Choosing no in user feedback

Figure 4.24. Choosing yes in user feedback

Figure 4.25. Feedback session


When users choose to answer the feedback session, they are redirected here as shown in Figure
4.25. They will be prompted to fill in their customer ID. Rating of the service, food and food
price will be asked too. After completing the feedback session, the user will be redirected to the
main menu by pressing any key.

Figure 4.26. Admin mode

35
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.26 shows the Admin mode. Choosing to enter Admin mode will prompt users to enter
the password required. Users are strictly restricted to entering the password for a maximum
attempt of 3 times only. Just like other passwords, the passwords entered are concealed and
further elongated with “*”. Users can enter “0” to go back to the main menu too.

Figure 4.27. 3 wrong password attempts


In Figure 4.27, the output of 3 wrong password attempts is shown. Users cannot continue to key
in the password after 3 failed tries. The user is asked to try again later and redirected to main
menu after pressing any key. Users can enter “0” to go back to the main menu too.

Figure 4.28. Admin mode interface


Figure 4.28 shows the main menu in Admin mode. In the menu are selections under two
categories, (A) Reservation and (B) Customer. In (A), there are functions to make new

36
TDS 2111 DATA STRUCTURES AND ALGORITHMS

reservation, display all reservation, search reservation, modify reservation, and delete reservation
while in (B) there are functions to display all customer record, search customer record, modify
customer record, and delete customer record. Users can enter “0” to go back to the main menu
too. Users will be prompted to enter their choice of selection where 1- new reservation, 2-
display all reservation, 3- search reservation, 4- modify reservation, 5- delete reservation, 6-
display all customer record, 7- search customer record, 8- modify customer record, and 9- delete
customer record. For search, modify, and delete in (A) Reservation, it is exactly the same process
as in customer main menu.

Figure 4.29. New reservation


To make new reservation using admin mode, the process is the same as using customer main
menu except users need to input the customer ID first as illustrated in Figure 4.29. The
following steps are the same as in making a new reservation from customer main menu as shown
in Figure 4.30 and Figure 4.31.

Figure 4.30 and Figure 4.31. New reservation

37
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.32. Display all reservation in admin mode


Figure 4.32 shows the page of selection -2- from Admin mode which is to display all
reservations. The information shown are reservation ID, customer ID, date, time, table number,
reservation type, and number of people. A sort function is also available at the bottom and can be
accessed by inputting yes(y/Y) or no(n/N). Choosing no will redirect the user to admin main
menu.

Figure 4.33. Sorting function for reservation


Meanwhile, choosing yes will redirect the user to a sorting function that prompts the user to pick
from the selection. Users can choose to sort by descending reservation ID, ascending date, or
descending date. Users can choose by inputting 1- descending reservation ID, 2- ascending date,
or 3- descending date. This is shown above in Figure 4.33. Sample results by different selection
are shown below in Figure 4.34, Figure 4.35, and Figure 4.36. After each sort is done, the user
will be redirected to admin main menu after pressing any key.

Figure 4.34. Sorting by descending reservation ID

38
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.35. Sorting by ascending date

Figure 4.36. Sorting by descending date

Figure 4.37. Display customer record


Figure 4.37 shows an example output of the display customer record. The information shown are
customer ID, name, contact number, and email. A sort function is also available at the bottom
and can be accessed by inputting yes(y/Y) or no(n/N). Choosing no will redirect the user to
admin main menu.

Figure 4.38. Sorting function for customer record

39
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Picking yes will redirect the user to a sorting function that prompts the user to pick from the
selection. Users can choose to sort by descending customer ID, ascending customer name, or
descending customer name. Users can choose by inputting 1- descending customer ID, 2-
ascending customer name, or 3- descending customer name. This is shown above in Figure 4.38.
Sample results by different selection are shown below in Figure 4.39, Figure 4.40, and Figure
4.41. After each sort is done, the user will be redirected to admin main menu after pressing any
key.

Figure 4.39. Sorting by descending customer ID

Figure 4.40. Sorting by ascending customer name

Figure 4.41. Sorting by descending customer name

40
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.42. Search customer record


The figure above, Figure 4.42 shows the search customer function selected from the admin main
menu. Users are prompted to key in a customer ID to search. Users can enter “0” to go back to
the main menu too.

Figure 4.43. Search result


In Figure 4.43, an example of a search result is shown. The information shown are searched by
customer ID, and the search results also include customer ID, name, contact number, and email.
Pressing any key will return users to the customer main menu.

Figure 4.44. Modify customer record


The figure above shows the result after selecting modify customer record admin main menu.
Users are prompted to enter the customer ID of the customer they want to modify. The modify
function edits the customer details and updates the information after modification.

41
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.45. Modify customer record result


Figure 4.45 shows the sample output of modifying the customer record. Users will need to fill in
new information just like how they made a new sign up in the system. The current customer ID
will be retained while other details will be changed as inputted.

Figure 4.46. Delete customer record


Figure 4.21 shows the delete customer record function. Users are prompted to enter the customer
ID of the customer they want to delete. A confirmation message will show on screen to let users
know that the deletion of the customer record is successful. Users can enter “0” to go back to the
main menu too.

42
TDS 2111 DATA STRUCTURES AND ALGORITHMS

Figure 4.47. Exit in main menu


Figure 4.47. shows the main menu when selecting -0- which is to exit the program. When exit is
selected, users will close the program after pressing any key.

43

You might also like