0% found this document useful (0 votes)
5 views16 pages

CS FWMS Project by Aryan

The document is a project report on a 'Food Waste Management System' submitted by Aryan Beniwal for Class XII at Greenfields Public School. It includes an introduction to food waste, management strategies, technology used, and an implementation plan, along with source code for a database management system. The report emphasizes the importance of reducing food waste for environmental sustainability and includes acknowledgments, a certificate, and a bibliography.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
5 views16 pages

CS FWMS Project by Aryan

The document is a project report on a 'Food Waste Management System' submitted by Aryan Beniwal for Class XII at Greenfields Public School. It includes an introduction to food waste, management strategies, technology used, and an implementation plan, along with source code for a database management system. The report emphasizes the importance of reducing food waste for environmental sustainability and includes acknowledgments, a certificate, and a bibliography.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 16

GREENFIELDS PUBLIC SCHOOL

COMPUTER SCIENCE PROJECT


ON
“ FOOD WASTE MANAGEMENT SYSTEM”

Submitted in partial fulfillment of the requirements


For
Class XII

Submitted to: Mrs. Suman Gupta


(Department Of Computer Science)

Submitted By:
NAME- Aryan Beniwal
CLASS- XII-C3
CBSE ROLL NO- 14610292
SUBJECT-Computer Science
SESSION-2024-25
ACKNOWLEDGEMENT

I extend my sincere gra tude to our school management for their unwavering
encouragement and provision of all necessary facili es for this project. Their
magnanimity is deeply appreciated.

I extend my hear elt apprecia on to Mrs. Suman Gupta, my computer science


instructor, for her invaluable guidance and unwavering support in the
successful comple on of this project. Her construc ve comments,
sympathe c a tude, and immense mo va on have sustained my e orts
throughout the project.

I cannot forget to express my gra tude to my classmates for their invaluable


assistance and support. Their advice and encouragement have been
instrumental in my success.

Aryan Beniwal
CERTIFICATE
This is to cer fy that this project report “Aryan Beniwal” is the bona de

work of “Food Waste Management System”, CBSE Board Roll No.

14610292 of class XII for the year 2024-25. He has carried out the project

work under my supervision.

Mrs. Suman Gupta


P.G.T. (Computer Science)
Internal Examiner External Examiner
INDEX

● INTRODUCTION

● FUNCTIONS USED

● TABLES IN DATABASE

● SOURCE CODE

● OUTPUT SCREENSHOTS

● BIBLIOGRAPHY
INTRODUCTION
1. Introduction to Food Waste

• De nition of Food Waste: Food waste occurs throughout the food supply
chain, from production to consumption. It refers to discarded food.

• Global and Local Impact: Discusses the global scale of food waste,
including its environmental impact, such as carbon emissions and
resource waste.

2. Types of Food Waste

• Pre-Consumer Waste: Waste during farming, processing, and packaging.

• Post-Consumer Waste: Waste generated by consumers at homes,


restaurants, and supermarkets, including unsold products in grocery
stores and restaurants.

3. Food Waste Management Strategies

• Prevention: Reduce food waste at the source by better planning, proper


storage, and technology.

• Reduction: Techniques like using nearing-expiration food and


redistributing surplus food to charities.
4.Technology in Food Waste Management

• Food Waste Tracking Systems: Software to monitor and manage waste.

• AI & Data Analytics: Predicts food demand to optimize inventory.

• Mobile Apps & Platforms: Enables consumers and businesses to buy,


donate, or share surplus food.

5. Key Players in the Food Waste Management Ecosystem

• Governments: Implement policies and regulations to encourage waste


reduction.

• Businesses: Adopt sustainable practices to minimize waste.

• Consumers: Reduce waste by shopping smart, using leftovers, and


composting.

6. Case Studies

• Successful Initiatives: Highlight programs such as the “Too Good To Go”


app.

• Corporate Examples: Companies like Starbucks and Tesco reducing food


waste in their supply chains.
7.Implementation Plan for a Food Waste Management System

• Goals and Objectives: De ne achievable targets (e.g., reducing waste by


30%).

• System Design: Outline processes from collection to redistribution or


disposal.

• Stakeholders Involved: Include local governments, businesses, NGOs, and


consumers.

8. Sustainability and Future Considerations

• Circular Economy Approach: Contribution of food waste management to


a circular economy.

• Innovative Technologies: Trends such as food waste-to-protein systems


and advanced composting.

• Behavioral Change: Education’s role in changing public attitudes.

9. Conclusion

• Highlights the paramount importance of food waste management in


fostering environmental sustainability, economic growth, and societal
well-being. Calls upon individuals, corporations, and governments to
take proactive steps in addressing this issue.
FUNCTIONS USED

1.mysql.connector.connect(): Establishes a connection to


MySQL.

2.self.db.cursor(): Creates a cursor to interact with the


database.

3.self.cursor.execute(): Executes SQL queries.

4.self.db.commit(): Commits changes to the database.

5.self.cursor.fetchall(): Fetches all rows from the query


result.

6.self.cursor.fetchone(): Fetches a single row from the


query result.

7.self.cursor.close(): Closes the cursor.

8.self.db.close(): Closes the database connection.


TABLES IN DATABASE

1. View all food items and their associated waste: This query
will display all records from the food_waste table:
2. View the total food waste: This query will calculate the total
waste from all food items:

3. View food waste data with food item count: If you want to see
the total waste per food item, you can group the results by the
food item:
SOURCE CODE
import mysql.connector

class FoodWasteManagement:
def __init__(self):
"""Initialize the connection to the MySQL database."""
self.db = mysql.connector.connect(
host="localhost", # Replace with your host
user="root", # Replace with your MySQL username
password="", # Replace with your MySQL password
database="food_waste_db" # Replace with your database name)
self.cursor = self.db.cursor()

# Create table if it does not exist


self.cursor.execute("""
CREATE TABLE IF NOT EXISTS food_waste (
id INT AUTO_INCREMENT PRIMARY KEY,
food_item VARCHAR(255) NOT NULL,
amount_wasted FLOAT NOT NULL
)
""")

def add_food_item(self, name, amount_wasted):


"""Add food waste data to the database."""
query = "INSERT INTO food_waste (food_item, amount_wasted) VALUES (%s,
%s)"
values = (name, amount_wasted)
self.cursor.execute(query, values)
self.db.commit()
print(f"Food item '{name}' with {amount_wasted} kg waste has been recorded.")
def view_waste_report(self):
"""Display a report of all food items and their associated waste from the database."""
query = "SELECT food_item, amount_wasted FROM food_waste"
self.cursor.execute(query)
result = self.cursor.fetchall()

if not result:
print("No food waste data available.")
else:
print("Food Waste Report:")
for food, waste in result:
print(f"- {food}: {waste} kg wasted")

def get_total_waste(self):
"""Calculate and display the total food waste from the database."""
query = "SELECT SUM(amount_wasted) FROM food_waste"
self.cursor.execute(query)
total_waste = self.cursor.fetchone()[0]
print(f"Total food waste: {total_waste} kg")

def close_connection(self):
"""Close the database connection."""
self.cursor.close()
self.db.close()

# Main function to interact with the Food Waste Management System


if __name__ == "__main__":
system = FoodWasteManagement()
while True:
print("\nFood Waste Management System")
print("1. Add Food Item Waste")
print("2. View Waste Report")
print("3. View Total Waste")
print("4. Exit")
try:
choice = int(input("Enter your choice (1-4): "))

if choice == 1:
name = input("Enter food item name: ")
amount = oat(input("Enter the amount of food wasted (kg): "))
system.add_food_item(name, amount)

elif choice == 2:
system.view_waste_report()

elif choice == 3:
system.get_total_waste()

elif choice == 4:
print("Exiting system.")
system.close_connection() # Ensure closing the database connection
break

else:
print("Invalid choice. Please try again.")
except ValueError:
print("Invalid input. Please enter a valid option.")
OUTPUT SCREENSHOT
BIBLIOGRAPHY

● Computer science with python by Sumita Arora

● Computer science with python book (PREETI ARORA)

● www.geeksforgeeks.org

● https://www.google.co.in/
THANK YOU

You might also like