Tải bản đầy đủ (.pdf) (28 trang)

Designing data structures, algorithms and building a convenience store management program

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 (7.46 MB, 28 trang )

<span class="text_page_counter">Trang 1</span><div class="page_container" data-page="1">

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING

FINAL REPORT

Course name: Algorithms and Data Structures

DESIGNING DATA STRUCTURES, ALGORITHMS AND BUILDING

A CONVENIENCE STORE MANAGEMENT PROGRAM

Ho Chi Minh City, …/…

</div><span class="text_page_counter">Trang 2</span><div class="page_container" data-page="2">

1.2. Purpose and requirements... 1

1.3. Scopes and objects... 1

1.4. Layout...1

PART 2. BACKGROUND KNOWLEDGE...3

2.1. Programming language, tools and environments... 3

3.3. Details of the algorithms...6

PART 4. TEST RESULTS AND DISCUSSIONS... 10

</div><span class="text_page_counter">Trang 3</span><div class="page_container" data-page="3">

FIGURE LIST

Figure 1: Management program block of convenience stores...6

Figure 2: Block File...6

Figure 3: Block Manager...7

Figure 4: Block Buy... 7

Figure 5: Block Product...7

Figure 6: Block Staff... 8

Figure 7: Block Customer... 8

Figure 8: Block ListProduct... 8

Figure 9: Block ListStaff...9

Figure 10: Block ListCustomer... 9

Figure 11: The interface "WELCOME TO STORE MANAGEMENT SYSTEM"...10

Figure 12: The interface "WELCOME TO STAFF MANAGEMENT SYSTEM"... 10

Figure 13: Enter information of Staff...11

Figure 14: List Staff load from .csv file...11

Figure 15: List Staff after add a Staff...12

Figure 16: Result of find a Staff...12

Figure 17: List Staff after Delete...13

Figure 18: Results of sorting Staff... 14

Figure 19: The interface "WELCOME TO PRODUCT MANAGEMENT SYSTEM"14 Figure 20: Enter information of Product...15

Figure 21: List Product load from .csv file... 15

Figure 22: List Product after add a Product... 16

Figure 23: List Product after Delete...16

Figure 24: Result of find a Product... 17

Figure 25: Result of sorting Product... 17

Figure 26: The interface "WELCOME TO CUSTOMER MANAGEMENT SYSTEM"18 Figure 27: Enter information of Customer...18

Figure 28: List Customer load from .csv file...19

Figure 29: List Customer after add a Customer...19

Figure 30: Result of sorting...20

Figure 31: The interface "WELCOME TO BUY MANAGEMENT SYSTEM"... 20

Figure 32: See the list before you buy... 21

Figure 33: Select the product and enter ID of Customer... 21

Figure 34: Print Bill...22

Figure 35: Statistic...22

Figure 36: Export to file as .csv... 23

</div><span class="text_page_counter">Trang 4</span><div class="page_container" data-page="4">

PART 1. PROJECT DESCRIPTIONS

1.1. Problem statement

Nowadays, there are an increasing number of convenience stores to meet shoppers' needs. As we all know, each product has a unique design and information, which causes many difficulties in product management, and manual management methods are currently not the best solution.

Along with the advancement and application of information technology in all aspects of modern life. The use of information technology to make management more convenient, faster, and scientific is an absolute necessity. It saves us human energy while also solving the problem correctly. As a result, more and more management software and applications are being used for application. Therefore, our group chose the topic: "Designing data structures, algorithms and building a convenience store management program" to end the course.

1.2. Purpose and requirements a) Purpose

Build a system that allows store owners to manage their stores in a simple, optimal, and effective manner. With features based on the actual requirements of shop owners to handle their work.

b) Requirements

The program must meet the information management of all products, employees, and customers:

About employees: including Name, ID, Phone number, Salary.

About products: including Name, ID, Price, Classification, Quantity, Product inventory.

About customers: including Name, ID, Phone number, bonus points. 1.3. Scopes and objects

a) Scopes

The research only stops at the implementation on laptop software and has not been applied in practice at any convenience stores.

b) Objects

Research subjects include employee management, product management and customer management

1.4. Layout

The report is divided into 5 parts: Part 1. Project descriptions Part 2. Background knowledge

</div><span class="text_page_counter">Trang 5</span><div class="page_container" data-page="5">

2 Part 3. Designs

Part 4. Test results and discussions Part 5. Conclusions

</div><span class="text_page_counter">Trang 6</span><div class="page_container" data-page="6">

PART 2. BACKGROUND KNOWLEDGE

2.1. Programming language, tools and environments

Program built with Visual Studio Code tools are powerful support tools that ensure technical simulation feasibility, low system resource consumption, and low product cost. Furthermore, we save information and data as.csv files.

The program is written in the C/C++ programming language.

MinGW is a free and open source C/C++ language compiler for Windows. For example, if you program C/C++ on a.c or.cpp file, MinGW will convert it to a binary code file that the computer can understand and run.

2.2. Support library #include

Notify the precompiler that standard libraries are being added in C++. Prototypes of commands used in the program body must be found in these standard libraries. #include <iostream>

iostream stands for Input/Output Stream that is a C++ standard library that allows you to receive input from the Console screen and output it back to the Console screen using input and output commands like cin, cout, ...

#include is a preprocessor that helps to install/add the source code of the iostream library inside your source code file, from which you can use the iostream library's cin and cout functions.

#include <iomanip>

It is used to declare services like setprecision and setw that are useful for performing formatting I/O.

#include <fstream>

This data type represents a File Stream and has the capabilities of both ofstream and ifstream, which means it can create files, write data to files, and read data from files.

#include <utility>

Define types, functions, and operators in the STL Standard Library to assist in the creation and management of object pairs. It comes in handy when two objects must be treated as if they were one.

#include <Windows.h>

Windows.h is a Windows header dedicated to the C and C++ programming languages. It contains declarations for all functions in the Windows API, all macros commonly used by Windows programmers, and all data types used by many functions and subsystems.

using namespace std;

</div><span class="text_page_counter">Trang 7</span><div class="page_container" data-page="7">

It is a collection of commonly used entities that are predefined in the iostream library of C++ standard versions for programmers' convenience and to avoid duplicate declaration errors.

#include "rapidcsv.h"

This is the header used to read/write data from the .csv file that we have created. 2.4. Methods

To manage convenience stores, in this project, our team uses 2 main methods, which are link list and sorting:

In C/C++, a structure is a user-defined data type. A structure defines a data type that can be used to combine items of potentially different types into a single type. It is useful if you have data that you do not intend to modify after creating structure.

It should be noted that in C++, the structure keyword is optional before declaring a variable.

Linked list:

A Linked List is an array of data structures that are linked together through links. A linked list is a data structure consisting of a group of nodes forming a sequence. Each node contains the data at that node and refers to the next node in the chain.

Since a singly linked list is a dynamic data structure created by dynamic allocation, it has several characteristics:

- Memory is allocated when running the program. - Can be resized by adding and removing elements.

- The maximum size depends on the available memory of the RAM. - Elements are stored non-consecutively in RAM.

And because of the associativity of the first element and the element that comes after it in a singly linked list, it has the following characteristics:

- Only need to know the first and last element to be able to manage the list. - Access to a random element must traverse from the beginning to that position.

Because of the above characteristics of the linked list, our team uses it in this program.

A Sorting Algorithm is used to rearrange the elements of an array or list based on a comparison operator on the elements. The comparison operator determines the new order of elements in a data structure.

</div><span class="text_page_counter">Trang 8</span><div class="page_container" data-page="8">

When a new product is to be moved into the store, this function is used to enter information about the product, product codes, product categories, price per product, and quantity. Excel files can be added, edited, deleted, searched, or exported. Staff management:

This function manages staff information such as name, employee code, gender, and phone number. Excel file can be added, edited, deleted, searched, or exported. Customer management:

This function manages information such as the customer's name, customer code, phone number, the number of products purchased, and the number of points accumulated. Excel file can be added, edited, deleted, searched, or exported.

Money statistics, quantity of goods sold, and product sales statistics. Manage store information:

Only administrators have access to this function.

Manage store information such as the store name, phone number, address, and so on.

The ability to edit information and calculate salary for a single employee. Manage Bill:

When a customer makes a purchase, the bill will include the product name, quantity, price, total amount and purchase date.

3.2. Block Diagram

To create the software, we built the block diagram for algorithms as below:

</div><span class="text_page_counter">Trang 9</span><div class="page_container" data-page="9">

Figure 1: Management program block of convenience stores 3.3. Details of the algorithms

Export file:

We will output data from the program in this block. It consists of three components: Product, Customer, and Staff. They will be saved as .csv files.

Figure 2: Block File

</div><span class="text_page_counter">Trang 10</span><div class="page_container" data-page="10">

Manage Store:

This section will primarily cover the process of entering and saving data for products, Staffs, and customers. Furthermore, the Manager has the ability to modify any task in the program.

Figure 3: Block Manager Buy:

In this block, we will enter ID of Staff, ID of Customer and quantity of product.

Figure 4: Block Buy

</div><span class="text_page_counter">Trang 11</span><div class="page_container" data-page="11">

This block allows you to enter product data such as ID, Name, Phone and Point.

Figure 7: Block Customer ListProduct:

This section contains functions that the user can perform, such as: Add, Delete, Search, Print all.

Figure 8: Block ListProduct ListStaff:

This section contains functions that the user can perform, such as: Add, Delete, Search, Print all.

</div><span class="text_page_counter">Trang 12</span><div class="page_container" data-page="12">

Figure 9: Block ListStaff ListCustomer:

This section contains functions that the user can perform, such as: Add, Delete, Search, Print all.

Figure 10: Block ListCustomer

</div><span class="text_page_counter">Trang 13</span><div class="page_container" data-page="13">

PART 4. TEST RESULTS AND DISCUSSIONS

The program executes as follows:

Figure 11: The interface "WELCOME TO STORE MANAGEMENT SYSTEM" When starting the program, the interface "WELCOME TO STORE MANAGEMENT SYSTEM" appears with 5 options including: MANAGE STAFF, MANAGE PRODUCT, MANAGE CUSTOM, BUY PRODUCT, STOP PROCESS. 4.1. Manage staff

Enter 0 to enter the MANAGE STAFF

Figure 12: The interface "WELCOME TO STAFF MANAGEMENT SYSTEM"

</div><span class="text_page_counter">Trang 14</span><div class="page_container" data-page="14">

Going to MANAGE STAFF will have the interface as below, similarly we will perform the following operations:

First, enter 1 to enter the information of Staff

Figure 13: Enter information of Staff Second, enter 2 to print List Staff

Figure 14: List Staff load from .csv file

</div><span class="text_page_counter">Trang 15</span><div class="page_container" data-page="15">

Figure 15: List Staff after add a Staff Choose 3 to Find a Staff

Figure 16: Result of find a Staff Choose 4 to Delete a Staff

</div><span class="text_page_counter">Trang 16</span><div class="page_container" data-page="16">

Figure 17: List Staff after Delete Choose 5 to sorting Staff:

</div><span class="text_page_counter">Trang 17</span><div class="page_container" data-page="17">

Figure 18: Results of sorting Staff 4.2. Manage product

Enter 1 to enter the MANAGE PRODUCT

Figure 19: The interface "WELCOME TO PRODUCT MANAGEMENT SYSTEM"

</div><span class="text_page_counter">Trang 18</span><div class="page_container" data-page="18">

Do the same steps as Staff

Enter 1 to enter the information of Product

Figure 20: Enter information of Product Enter 2 to print List Product

Figure 21: List Product load from .csv file

</div><span class="text_page_counter">Trang 19</span><div class="page_container" data-page="19">

Figure 22: List Product after add a Product Enter 3 to Delete a Product

Figure 23: List Product after Delete Enter 4 to Find a Product

</div><span class="text_page_counter">Trang 20</span><div class="page_container" data-page="20">

Figure 24: Result of find a Product Choose 5 to sorting Product

Figure 25: Result of sorting Product 4.3. Manage customer

</div><span class="text_page_counter">Trang 21</span><div class="page_container" data-page="21">

Figure 26: The interface "WELCOME TO CUSTOMER MANAGEMENT SYSTEM"

Do the same steps:

Enter 1 to enter the information of Customer

Figure 27: Enter information of Customer Enter 2 to print List

</div><span class="text_page_counter">Trang 22</span><div class="page_container" data-page="22">

Figure 28: List Customer load from .csv file

Figure 29: List Customer after add a Customer Enter 4 to Sorting Customer

</div><span class="text_page_counter">Trang 23</span><div class="page_container" data-page="23">

Figure 30: Result of sorting 4.4. Manage buy product

Figure 31: The interface "WELCOME TO BUY MANAGEMENT SYSTEM"

</div><span class="text_page_counter">Trang 24</span><div class="page_container" data-page="24">

Figure 32: See the list before you buy

Figure 33: Select the product and enter ID of Customer

</div><span class="text_page_counter">Trang 25</span><div class="page_container" data-page="25">

22 Figure 34: Print Bill

Figure 35: Statistic

</div><span class="text_page_counter">Trang 26</span><div class="page_container" data-page="26">

Figure 36: Export to file as .csv

</div><span class="text_page_counter">Trang 27</span><div class="page_container" data-page="27">

PART 5. CONCLUSIONS

5.1. Discussions a) Advantage:

The program has an easy-to-use interface.

Editing, adding, searching... are all done quickly and easily. It is appropriate for small-scale deployment applications. Simple to use and manage.

b) Limitation:

Due to limited research time and capacity, a number of issues remain only ideas and have not been put into practice.

The program is unprofessional and has few features.

The issues that arose during the processing of input data have not been fully resolved.

Although the interface is user-friendly, the aesthetic value is low. 5.2. Conclusion

In short, a convenience store management system is a very useful system because it makes managing issues like staff, products, and customers easier, faster, and more convenient.

We created this system in the hopes that it will be widely used to help convenience stores in particular and current large and small supermarkets in general.

5.3. Recommendation

We intend to develop data management software that can handle additional challenges in the future.

Furthermore, we want to develop an app that integrates with the smartphone so that the shop owner can manage it at all times.

</div>

×