SkinCareProductSaleSystem Report
SkinCareProductSaleSystem Report
1. Introduction
The ‘Skin Care Product Sale System’ is a Python-based desktop application designed to
automate the management and transaction processes of a local vendor named WeCare,
which specializes in beauty and skin care products. This system efficiently handles product
listings, manages inventory, facilitates sales, generates invoices, and allows restocking, all
while applying promotional policies such as the ‘buy three get one free’ scheme.
This application emphasizes modular design with dedicated functions for sales, restocking,
and invoice generation. Customer and supplier details are validated through regular
expressions, and invoice records are saved as separate text files for auditing and
accountability. The implementation ensures user-friendliness with clear prompts and error
handling to guide users through the system.
The following report details the entire development process of the system—from
conceptualization and algorithm design to coding, testing, and final output generation. This
documentation also provides visual aids such as flowcharts, pseudocode, and screenshots
that illustrate the functionality of the application.
2. Aims and Objectives
- To develop a Python application that automates the sales and inventory process of a
skincare product vendor.
- To implement a ‘Buy 3 Get 1 Free’ policy in the sales process.
- To read, display, and update product data from a structured text file.
- To generate detailed and printable customer and supplier invoices in .txt format.
- To handle input validations, especially for email and phone number formats.
- To ensure modularity, code reusability, and error handling throughout the application.
- To reinforce understanding of file operations, data structures, loops, and functions in
Python.
4. Algorithm
The following is the algorithm for the Skin Care Product Sale System:
5. Pseudocode
BEGIN
LOAD product list from 'products.txt'
WHILE user has not exited
DISPLAY menu options
IF choice is Display Products THEN
DISPLAY all product details
ELSE IF choice is Make a Sale THEN
GET customer details
ALLOW product selection and quantity input
FOR each product selected
CALCULATE free item as quantity DIV 3
UPDATE stock
COMPUTE total cost
GENERATE and SAVE customer invoice
ELSE IF choice is Restock THEN
GET supplier info
SELECT product and input new quantity and cost
UPDATE product data
GENERATE and SAVE restock invoice
ELSE IF choice is Exit THEN
SAVE updated product list to 'products.txt'
EXIT
END WHILE
END
6. Flowchart
A flowchart for the system is to be inserted here. It visually represents the control flow and
decision structures described in the algorithm above. Use draw.io, Lucidchart, or MS Word’s
shapes tool to draw a flowchart, then insert it in the final document.
- **Lists**: Used for storing multiple selected items during sales and restocking.
Example: `products_bought = [(1, product), (2, product)]`
- **Strings**: Used for handling names, brands, and formatting invoice content.
- **Integers**: For storing and calculating quantities, prices, and totals.
- **Tuples**: For returning multiple values like customer details.
- **Datetime Objects**: For timestamping invoices.
- **Python 3.x**: The main programming language used to develop the entire system.
Python was chosen due to its simplicity, wide range of libraries, and suitability for file
handling, string processing, and functional programming.
- **Visual Studio Code (VS Code)**: The code editor used for writing and debugging the
Python script. It provides extensions, syntax highlighting, and integrated terminal support.
- **Windows Operating System**: The development and testing of the system were
performed on a Windows platform.
- **Text Files (.txt)**: Used to store product inventory and generate invoices. Text files
provide a lightweight method for persistent data storage.
- **MS Word (Microsoft Word)**: Used to create and compile the project report, including
documentation, screenshots, diagrams, and formatting required by the coursework.
- **Python Built-in Libraries**:
- **datetime**: Used to timestamp customer and restock invoices.
- **re**: Regular expressions were used for validating email addresses and phone
numbers.
- **os** (optional): Could be used for file and path operations.
- **List**:
Lists are used to keep track of items purchased or restocked in a transaction.
Example:
products_bought = [(1, products[1]), (2, products[2])]
This keeps order and allows grouping of similar items for invoice generation.
- **Tuple**:
Tuples are used to return multiple pieces of information from a function.
Example:
def get_customer_details() -> returns (name, email, phone)
- **String**:
Strings are used throughout the system for names, labels, and invoice content formatting.
- **Integer**:
Integers are used for quantity calculations, pricing, and VAT computation.
- **Datetime Object**:
The datetime module is used to insert timestamps into the invoice files for both sales and
restocking.
- **Dictionaries**: Python dictionaries are used as the primary data structure for storing the
inventory. Each product has a unique numerical key that maps to a list of product details
such as name, brand, quantity, cost price, and country of origin. This structure allows
constant-time access and updates, making it ideal for searching, adding, or modifying
product information. For instance, when a product is sold, the quantity is updated directly
using its ID, and during restocking, the cost and quantity can be modified seamlessly.
Dictionaries provide key-value mapping which reduces complexity in lookup operations
compared to linear search in lists.
- **Tuples**: Tuples serve as immutable containers for grouped data that shouldn't change
once created. They are used to return multiple values from functions such as customer
details (name, email, phone). Since tuples are immutable, they ensure that data once
captured is not accidentally altered later in the code. Their use supports better function
return structure and enhances code readability and reliability.
- **Strings**: Strings form the basis of user interface display, invoice formatting, and
customer or supplier identification. They are used extensively for creating formatted
invoice lines, headers, and error messages. String manipulation functions allow us to align
data properly in the console and files, and help maintain a professional and clean layout for
outputs.
- **Datetime Objects**: The datetime module provides support for working with
timestamps. These objects are used to create date-stamped filenames for invoices and to
insert the current date and time into the invoice content. This makes tracking and auditing
easier, especially when verifying when a sale or restock occurred.
8. Program Description
The Skin Care Product Sale System is structured using a modular programming approach.
The application begins by loading product data from a text file, which is converted into a
dictionary for efficient access. The user is presented with a menu offering options to display
products, make sales, restock inventory, or exit the program.
10. Conclusion
This project has effectively demonstrated the application of core programming concepts in
developing a practical and fully functional sales and inventory management system.
Through the use of Python’s built-in functions and data structures, the Skin Care Product
Sale System achieves automated handling of inventory, customer transactions, and
restocking. The modular design ensures that each component can be reused, tested, and
maintained independently.
One of the highlights of this project was integrating a promotional policy—‘Buy 3 Get 1
Free’—into the logic of the system, which involved conditional arithmetic and inventory
checks. The report includes the complete workflow from algorithm design and flowchart
creation to testing and documentation.
The project reinforced the practical use of Python for real-world problems and highlighted
the importance of data validation, structured file handling, and user interface design. With
scope for future enhancements like GUI implementation or database integration, the
foundation laid by this project is robust and extensible.
11. References
- Python Software Foundation. (n.d.). Python documentation. https://docs.python.org/3/
- W3Schools. (n.d.). Python Tutorial. https://www.w3schools.com/python/
- GeeksforGeeks. (n.d.). Python Programming Examples.
https://www.geeksforgeeks.org/python-programming-language/
- Microsoft. (n.d.). Draw a flowchart in Word. https://support.microsoft.com/
- Real Python. (n.d.). Working with Files in Python. https://realpython.com/working-with-
files-in-python/
- **Python 3.x**: Python served as the backbone of the application due to its clear syntax,
readability, and rich ecosystem of libraries. It is particularly effective for beginners and
intermediate programmers, making it ideal for educational settings. Python enabled us to
utilize essential programming concepts like functions, conditional statements, loops, file
handling, and regular expressions with ease. Additionally, Python's dynamic typing and
built-in data structures significantly reduced the development time.
- **Visual Studio Code (VS Code)**: VS Code was chosen as the Integrated Development
Environment (IDE) due to its wide adoption, customizability, and rich feature set. It
supports Python natively through extensions and provides debugging, Git integration, and
terminal access, which made coding and testing more efficient.
- **Windows Operating System**: The system was developed and tested on a Windows
platform, which offered a user-friendly interface and compatibility with the tools. Python,
VS Code, and file-based interactions worked seamlessly in this environment.
- **Text Files (.txt)**: Used for both storing product data and generating invoices. Text files
were easy to read and write using Python’s built-in file handling functions. This format
ensured portability and made it easy to view and verify stored data without needing
specialized software.
- **Microsoft Word**: MS Word was used to write and compile the project report. It
provided tools for formatting, inserting tables, organizing the Table of Contents, and
embedding diagrams and screenshots. Word was instrumental in producing a clean and
professional submission that aligned with university standards.
- **Python Libraries**:
• **datetime** – used to generate timestamps for invoices and logs.
• **re** – regular expression module for validating user inputs such as emails and phone
numbers.
• **os** (optional) – could be used for future enhancements in managing file paths or
system-level automation.
Together, these tools provided a strong foundation for successful project execution. Their
combined use ensured that the system was not only functional but also well-documented,
maintainable, and user-friendly. Future iterations of this project could incorporate more
advanced technologies such as SQL databases or web frameworks, but the current selection
fully supported the educational objectives and technical requirements of the coursework.
5. **Microsoft Word**
Microsoft Word was used extensively to document the system design, logic, and testing
phases. It provides comprehensive formatting tools, easy insertion of images, and
automated table of contents generation. These features made the report visually organized
and aligned with academic formatting standards, enabling a professional submission.
**1. Dictionary**
Used in `read_products()` and throughout the system to hold all product data. The
dictionary uses numeric IDs as keys and a list of product attributes as values:
```python
products = {1: ['Vitamin C Serum', 'Garnier', '10', '500', 'France']}
```
This structure allows fast lookup and update of products, for example:
```python
products[product_id][2] = str(int(products[product_id][2]) - quantity)
```
**2. List**
Lists are used to collect multiple items during a transaction, such as products bought or
restocked:
```python
products_bought = [(product_id, products[product_id])]
quantities = [3, 2, 1]
```
These lists are iterated when generating invoices.
**3. Tuple**
Tuples are used for fixed sets of data like customer details, returned from
`get_customer_details()`:
```python
return name, email, phone
```
They ensure that the returned data is structured and unchangeable.
**5. datetime**
The `datetime` module is used to timestamp invoices:
```python
datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
```
This ensures each invoice file is uniquely named and traceable.
1. Introduction (Updated)
As part of the Fundamentals of Computing coursework, I developed a Python-based desktop
application titled 'Skin Care Product Sale System'. This system was designed to assist a local
skincare vendor named WeCare in managing its product inventory, processing sales, and
handling restocking operations. My primary aim was to automate key retail operations and
ensure all transactions were recorded accurately with proper invoice generation.
Overall, this project not only strengthened my Python programming skills but also taught
me how to approach a full application development cycle—from planning and coding to
testing and documenting. I believe this experience has laid a strong foundation for more
complex future projects.