Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
32 views17 pages

CS Project (New) - Numbered (3) - Pagenumber

The project report details the development of a 'Groceries Shopping System' using Python, focusing on creating a shopping cart that allows users to add, update, and remove items while calculating total costs. It highlights the use of Python dictionaries for efficient data management and outlines the project's features, system architecture, and coding implementation. The report concludes with an overview of the project's educational value and system requirements for operation.
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)
32 views17 pages

CS Project (New) - Numbered (3) - Pagenumber

The project report details the development of a 'Groceries Shopping System' using Python, focusing on creating a shopping cart that allows users to add, update, and remove items while calculating total costs. It highlights the use of Python dictionaries for efficient data management and outlines the project's features, system architecture, and coding implementation. The report concludes with an overview of the project's educational value and system requirements for operation.
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/ 17

ST.

PATRICK HIGHER SECONDARY


SCHOOL PUDUCHERRY-605005

Project Report On
GROCERIES
SHOPPING SYSTEM

Submitted in Partial Fulfillment of the Requirements


for Central Board of Secondary Education (CBSE)
Grade11
COMPUTER SCIENCE

Submitted By
KEERTHIVASAN.C
Class: XI-D
RollNo: 11312
Reg.No. :

Guided By
Mr. S. RAJENDREN
Subject Teacher

1
CERTIFICATE
This is to certify that the project titled “GROCERIES SHOPPING SYSTEM”
is a bonafide work carried out by KEERTHIVASAN.C,a student of Class 11-
D at St.Patrick Higher Secondary School , for the subject COMPUTER
SCIENCE during the academic year 2024-2025.
The project has been completed under my guidance and supervision in
accordance with the requirements of the Central Board of Secondary
Education (CBSE).

INTERNAL EXTERNAL
EXAMINER EXAMINER

PRINCIPAL

DATE:

SCHOOL STAMP

2
ACKNOWLEDGEMENT

I would like to express my heart felt gratitude to all those who have
provided guidance, support and assistance in completing this project.
Firstly, I extend my sincere thanks to our respected Correspondent , Mr.
Regis Fredrick.R, Principal, Mrs.Stella Pauline Punitha.J, of St.Patrick
Higher Secondary school, for providing this opportunity and a
supportive environment to undertake this project. Their leadership and
encouragement have been a source of inspiration throughout my
academic journey.
I am deeply grateful to my subject teacher, Mr. S. Rajendren, for their
invaluable guidance, encouragement, and constructive feedback
throughout the course of this project. Their insights and expertise have
been crucial in shaping the direction and out come of my work.
I also want to acknowledge my family and friends for their unwavering
support and encouragement, especially during challenging times.
Lastly, I am thankful to all others who, directly or indirectly, have
contributed to the successful completion of this project.
Thank you all for your support and encouragement.

3
Index:
S.NO CONTENT Pg.No

1. INTRODUCTION 5

2. DOCUMENTATION 6

3. FLOW DIAGRAM 7

4. PYTHON CODING 8 - 11

5. OUTPUT 12 - 13

6. CONCLUSION 14

7. REQUIRED HARDWARE/SOFTWARE 15

8. REFERENCE MATERIAL 16

4
INTRODUCTION:

The "Groceries Shopping System" is a core component of modern e-commerce


platforms, enabling customers to browse, select, and manage products they wish
to purchase. This project aims to develop a simplified yet efficient shopping cart
system by leveraging Python dictionaries as the primary data structure for
handling and managing cart operations.

In the context of programming, a shopping cart system requires effective data


organization to perform operations like adding items, removing items, updating
quantities, and calculating the total cost. Dictionaries, with their key-value pair
structure, offer a powerful and intuitive way to store and retrieve data, such as
product details, quantities, and prices, in real-time. The constant time complexity
for retrieval and updates makes them an ideal choice for this purpose.

The proposed system is designed to handle typical shopping cart functionalities,


such as:

1. Adding Products: Allowing users to add items to their cart by


specifying product identifiers.
2. Updating Cart: Enabling users to modify the quantity or remove items
from their cart.
3. Cart Summary: Calculating the total cost of items in the cart,
including features like discounts or taxes.

This dictionary-based shopping cart system also emphasizes simplicity and


scalability, making it a foundational tool for understanding how data structures
can support real-world applications. As an educational project, it offers hands-on
experience with Python programming, data manipulation, and algorithmic
thinking. By completing this project, developers gain insights into building
essential components of larger e-commerce solutions.

5
Documentation:

Features:

1. Add products to the cart.


2. View and update cart contents.
3. Remove items from the cart.
4. Calculate the total price.
5. Checkout process.

System Architecture:

The project uses dictionaries for key data:

 Products: Store product IDs, names, and prices.


 Cart: Store selected product IDs and their quantities.

Workflow:

1. User views available products.


2. Adds items to the cart.
3. Modifies the cart (add, remove, update quantities).
4. Proceeds to checkout.
5. Views final bill and confirms the order.

6
Flow Chart:-

START

DISPLAY
MAIN
MENU

GET
USER’S
CHOICE

INVALID PERFORM ACTION

UPDATE &
DISPLAY
CART
INFORMATION

EXIT /
CONTINUE

7
Python Coding:-
# Groceries Shopping System

# Predefined store items (item: price)

store_items = {

"Apple": 0.50,

"Banana": 0.30,

"Orange": 0.70,

"Milk": 1.50,

"Bread": 2.0,

"Eggs": 3.0

# Shopping cart (item: quantity)

shopping_cart = {}

while True:

# Display menu

print("=== Shopping Cart Menu ===")

print("1. View Available Items")

print("2. Add Item to Cart")

print("3. Remove Item from Cart")

print("4. View Cart")

print("5. Checkout")

print("6. Exit")

choice = input("Choose an option (1-6): ")

8
if choice == "1":

# View available items

print("Available Items:")

for item, price in

store_items.items(): print(item, ":

$",price)

elif choice == "2":

# Add item to cart

item = input("Enter the name of the item to add: ").title()

if item in store_items:

quantity = int(input("How many items would you like to add?"))

if item in shopping_cart:

shopping_cart.append(quantity)

else:

shopping_cart[item] = quantity

print("The following products added to the cart.")

else:

print("Item not found in the store.")

elif choice == "3":

# Remove item from cart

item = input("Enter the name of the item to remove: ").title()

if item in shopping_cart:

quantity = int(input("How many item(s) would you like to remove? "))

if quantity >= shopping_cart[item]:

9
shopping_cart.pop(item)

print("Removed the item(s) from the cart.")

else:

shopping_cart[item] -= quantity

print("Removed it from the cart.")

else:

print("Item not found in the cart.")

elif choice ==

"4": # View

cart

if not shopping_cart:

print("Your cart is

empty.")

else:

print("Items in your cart:")

total = 0

for item, quantity in

shopping_cart.items(): price =

store_items[item] * quantity

print(item,":", quantity, "@ $",store_items[item], "each = $",price)

total += price

print("Total: $",total)

elif choice ==

"5": #
1
Checkout

if not shopping_cart:

1
print("Your cart is empty. Add items before checking out.")

else:

print("Items in your cart:")

total = 0

for item, quantity in

shopping_cart.items(): price =

store_items[item] * quantity

print(item,":", quantity, "@ $",store_items[item], "each = $",price)

total += price

print("Total: $",total)

confirm = input("Do you want to proceed to checkout? (yes/no): ").lower()

if confirm == "yes":

print("Thank you for shopping! Your order has been placed.")

shopping_cart.clear()

else:

print("Checkout canceled.")

elif choice == "6":

# Exit the program

print("Exiting the Shopping Cart System. Goodbye!")

break

else:

print("Invalid choice. Please try again.")

1
Output:-

1
1
Conclusion:
 The development of the Groceries Shopping System based on a dictionary
structure has proven to be an effective solution for simulating a simple yet
functional online shopping experience. By using dictionaries, we have
efficiently managed product information and user interactions such as
adding, removing, and viewing items in the cart. The dictionary-based
approach provides a fast, easy-to-understand method for mapping product
names to their corresponding details (like prices and quantities), allowing
for seamless operations.
 Throughout the project, we achieved the key objectives of allowing users
to add products, update quantities, and view the total cost, mimicking the
core features of a real-world e-commerce platform. Moreover, this project
highlighted the utility of Python's dictionary as an in-memory storage
structure, showing how it can be leveraged for organizing data in a
manageable way.
 In conclusion, the Groceries Shopping System demonstrates how simple
data structures can be used to implement critical functionality in software
systems, and it lays the groundwork for more complex systems in the
future. While this prototype is basic, it offers a clear understanding of how
online shopping systems manage products, prices, and transactions, making
it a valuable learning tool for developing further e-commerce applications.

1
OS and System Requirements:-
Operating System:
The "Groceries Shopping System" is a lightweight application and can run on a
variety of operating systems, including:

 Windows: Windows 7, 8, 10, or later


 Linux: Any modern distribution (e.g., Ubuntu, Fedora, Debian)
 macOS: macOS Mojave (10.14) or later

Software Requirements:
 Programming Language: Python 3.7 or higher
 IDE/Code Editor: Any modern IDE or text editor, such as Visual
Studio Code, PyCharm, or Jupyter Notebook
 Dependencies: No external libraries are mandatory for the core system,
but optional packages for enhancements include:
o tkinter (for graphical user interface)
o pytest (for unit testing)
o pip (for dependency management)

Hardware Requirements:
 Processor: Dual-core processor or higher (Intel i3/AMD Ryzen 3 or better)
 RAM: Minimum 2 GB (4 GB recommended for smooth performance)
 Storage: At least 50 MB of free disk space for project files
and dependencies
 Display: 1024x768 resolution or higher

Optional Enhancements (if applicable):


 Database Integration: Requires a lightweight database (e.g., SQLite) or a
full-fledged database system (e.g., MySQL, PostgreSQL) if database
support is added.
 Web Framework Support: If extended to a web application,
frameworks like Flask or Django would require installation.
 Web Browser: If a web-based version is implemented, a modern web
browser (e.g., Chrome, Firefox) will be necessary for testing and
usage.

1
REFERENCE MATERIAL :
Online Articles:
 Python Software Foundation. (2024). Python Documentation:
Data Structures. Retrieved
from: https://docs.python.org/3/tutorial/datastructures.html
 The official Python documentation on data structures, including
detailed information on dictionaries and how they can be applied
in various scenarios.

 GeeksforGeeks. (2024). Python Dictionary: A Complete Guide.


Retrieved from: https://www.geeksforgeeks.org/python-dictionary/
 An in-depth guide on Python dictionaries, offering practical
examples and explanations for their use in managing and storing
data.

 Real Python. (2024). Python Dictionaries: A Beginner’s


Guide. Retrieved from: https://realpython.com/python-dicts/

Websites:
 W3Schools. (2024). Python Dictionary. Retrieved
from: https://www.w3schools.com/python/python_dictionaries.asp
 A beginner-friendly resource explaining the basics of Python
dictionaries, how to use them for tasks like managing product data
in a shopping cart

Additional Source:

1. ChatGpt
2. Google Chrome

You might also like