0% found this document useful (0 votes)
25 views13 pages

SkinCareProductSaleSystem Report

The Skin Care Product Sale System is a Python-based application designed to automate the sales and inventory management for a skincare vendor, WeCare. It includes features such as product listings, sales processing with a 'Buy 3 Get 1 Free' policy, and invoice generation, all while ensuring data validation and user-friendliness. The project demonstrates key programming concepts and utilizes various data structures and tools to create a modular, efficient, and maintainable system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views13 pages

SkinCareProductSaleSystem Report

The Skin Care Product Sale System is a Python-based application designed to automate the sales and inventory management for a skincare vendor, WeCare. It includes features such as product listings, sales processing with a 'Buy 3 Get 1 Free' policy, and invoice generation, all while ensuring data validation and user-friendliness. The project demonstrates key programming concepts and utilizes various data structures and tools to create a modular, efficient, and maintainable system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Skin Care Product Sale System

Module Code: CS4051NI / CC4059NI

Module Title: Fundamentals of Computing

Student Name: [Your Full Name]

Student ID: [Your Student ID]

Instructor: Ms. Pranchee Singh

Institution: Islington College, Affiliated to London Metropolitan University

Submission Date: 02 May 2025


Table of Contents
1. 1. Introduction
2. 2. Aims and Objectives
3. 3. Tools and Technologies Used
4. 4. Algorithm
5. 5. Pseudocode
6. 6. Flowchart
7. 7. Data Structures
8. 8. Program Description
9. 9. Testing and Validation
10. 10. Conclusion
11. 11. References

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.

The project is designed as a real-world application of fundamental computing principles


taught in the Fundamentals of Computing module. Through its development, core
programming concepts such as file handling, control structures, functions, data validation,
and object-oriented programming have been explored. The program reads and updates a
text file containing product information and ensures that changes in inventory after each
transaction are accurately recorded.

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.

3. Tools and Technologies Used


- Programming Language: Python 3.x
- IDE: VS Code / PyCharm / IDLE
- File Format: .txt for persistent data storage and invoice recording
- Data Structures: Lists, Dictionaries, Strings, Tuples
- Libraries: datetime, re (regular expressions), os (optional for file management)
- Platform: Windows OS (compatible with any Python-supported environment)

4. Algorithm
The following is the algorithm for the Skin Care Product Sale System:

Step 1: Start the program.


Step 2: Load product data from the text file into a dictionary.
Step 3: Display the main menu with options:
a. Display Available Products
b. Make a Sale
c. Restock Products
d. Exit
Step 4: If 'Display Products' is selected:
- Display all products with details.
Step 5: If 'Make a Sale' is selected:
- Get customer details and validate input.
- Display available products.
- Allow user to select products and quantities.
- Calculate free items using 'Buy 3 Get 1 Free' policy.
- Update inventory and calculate total.
- Generate and save customer invoice.
Step 6: If 'Restock Products' is selected:
- Input supplier details.
- Select products and enter new stock quantity and cost.
- Update inventory and generate restock invoice.
Step 7: If 'Exit' is selected:
- Save all updated data to the file.
- Exit the system.
Step 8: End.

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.

**[Insert Flowchart Image Here]**


7. Data Structures
The following data structures are used in the program:

- **Dictionaries**: Used to store product data with unique IDs.


Example: `products = {1: ['Vitamin C Serum', 'Garnier', '10', '500', 'France']}`

- **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.

3. Tools and Technologies Used


During the development of the Skin Care Product Sale System, the following tools and
technologies were utilized:

- **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.

7. Data Structures (Detailed)


Data structures are essential for organizing and managing data in the system. Below is a
detailed breakdown of the various data structures used:
- **Dictionary**:
A Python dictionary is used to store the products, using a unique product ID as the key and
the product details as values.
Example:
products = {
1: ['Vitamin C Serum', 'Garnier', '10', '500', 'France'],
2: ['Sunscreen', 'Aqualogica', '7', '350', 'India']
}
This structure allows constant-time access to product data and easy updates during sales
and restocking.

- **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.

7. Data Structures (Detailed)


Data structures are critical components in any software development process as they
determine how data is organized, accessed, and manipulated. In the Skin Care Product Sale
System, several built-in Python data structures are employed to handle operations
efficiently and logically.

- **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.

- **Lists**: Lists are utilized to store collections of products selected by customers or


suppliers during sales and restock operations. These structures support ordering and are
easily iterable, making them perfect for managing multiple items in a cart-like format.
During a sale, each selected item is appended to a list along with its quantity, and this list is
then used to generate invoices and compute totals. Lists are also ideal for scenarios where
order is important and items may be duplicated or grouped.

- **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.

- **Integers**: Integers are necessary for performing arithmetic operations such as


computing total quantities, calculating discounts, computing totals and VAT. They are also
used in loops and conditional statements where numeric comparison or counters are
required. Every quantity and pricing variable is maintained as an integer for efficient
mathematical computation.

- **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.

Each option invokes dedicated functions:


- Displaying products shows a formatted list of all items with their brand, quantity, selling
price, and origin.
- Making a sale includes collecting validated customer details, selecting products, applying
the 'Buy 3 Get 1 Free' offer, calculating totals, and generating a detailed invoice that is
printed and saved to a file.
- Restocking involves entering supplier information, selecting items to update, modifying
quantities and prices, and generating a separate invoice that is also saved.
The program ensures data validation, error handling, and updates the master product file
after every transaction. It continues to run in a loop until the user selects exit.

9. Testing and Validation


Testing was carried out by executing the program and simulating various real-world
interactions such as selling products, restocking, inputting invalid values, and generating
invoices. Below are the key testing cases validated:

- Displaying available products with accurate calculations of selling price.


- Validating customer email and phone number inputs using regular expressions.
- Ensuring 'Buy 3 Get 1 Free' policy is applied correctly across different quantities.
- Verifying invoices are created and saved with accurate item listings and total calculations.
- Checking inventory file is updated accurately after each sale and restock.

**[Insert Screenshot of Program Execution Here]**

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/

3. Tools and Technologies Used


The development of the Skin Care Product Sale System utilized a comprehensive set of tools
and technologies that were chosen for their robustness, accessibility, and compatibility with
the goals of the coursework. Below is a detailed explanation of the tools used throughout
the project lifecycle:

- **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.

3. Tools and Technologies Used (Expanded)


1. **Python 3.x**
Python was selected as the primary programming language for the system due to its
versatility, readability, and strong support for rapid application development. It provides
built-in data types and supports various paradigms including object-oriented, procedural,
and functional programming. Python makes handling files, strings, lists, and dictionaries
simple and intuitive, which is vital for a system that manages dynamic product inventories
and transaction records. Its community support and vast library ecosystem also ensure that
issues can be quickly resolved, and future enhancements can be easily integrated.

2. **Visual Studio Code (VS Code)**


VS Code was the IDE of choice for its lightweight design and advanced features. It supports
Python syntax highlighting, linting, real-time debugging, version control integration, and
extension-based customization. These features enhanced development productivity,
allowing the programmer to easily manage files, view outputs, and handle any bugs
encountered during the creation of the system. Moreover, its terminal integration allowed
quick access to script execution and error logging.

3. **Windows Operating System**


The development and testing were conducted on the Windows OS due to its accessibility
and compatibility with most Python development tools. Windows provided a stable
graphical interface and straightforward file system which supported the handling of the .txt
files for product records and invoices. Its compatibility with Python and VS Code ensured a
smooth coding and testing environment for this coursework.

4. **Text Files (.txt)**


The system used plain text files to store and persist data between executions. Products are
initially loaded from a file, and after each transaction or restock, the file is updated
accordingly. Separate text files are generated for customer and restock invoices, which
contain formatted details about transactions. The simplicity and portability of text files
make them an ideal choice for basic inventory systems.

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.

6. **Python Standard Libraries**


Modules like `datetime` and `re` were crucial for handling dates and input validations.
`datetime` ensures invoices are timestamped accurately, helping in transaction tracking. `re`
(Regular Expression) ensures that user-provided emails and phone numbers are formatted
correctly. These libraries reduced development time and increased program reliability.

7. Data Structures with Code References


The program used several essential Python data structures. Below is a description of each
along with references from the provided source code:

**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.

**4. Strings and Integers**


Strings are used to store names, brands, and invoice content. Integers are used to calculate
totals and manage quantity:
```python
selling_price = int(products[product_id][3]) * 2
total_amount += (quantity - free_items) * selling_price
```

**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.

During the development of this project, I aimed to enhance my understanding of real-world


problem-solving using programming. The goal was to apply theoretical concepts from the
module into a practical software solution that would benefit users by reducing manual
effort and increasing reliability. The system implements a unique sales promotion policy
—'Buy 3 Get 1 Free'—which I had to model carefully using logic and arithmetic operations.

While working on the system, I encountered challenges related to data validation,


particularly ensuring that email and phone number inputs were correctly formatted.
Managing file read/write operations also required precision, especially when updating the
inventory after each transaction. Another challenge was ensuring that invoice files were
properly formatted and saved with unique names to prevent overwriting.
Through this project, I learned how to structure a Python program modularly using
functions, how to work with file systems, and how to handle input validation using regular
expressions. I also deepened my understanding of dictionaries, lists, and tuples by using
them to manage data effectively. Additionally, I became more confident in debugging, error
handling, and producing clean, user-friendly outputs.

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy