0% found this document useful (0 votes)
201 views45 pages

Computer Science Project - Laundry Management System

I created this to submit for my Class 12th Computer Science Project. A like would be much appreciated :)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
201 views45 pages

Computer Science Project - Laundry Management System

I created this to submit for my Class 12th Computer Science Project. A like would be much appreciated :)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 45
M. COMPUTER SCIENCE INVESTIGATORY PROJECT i LAUNDRY MANAGEMENT SYSTEM 4 BONAFIDE CERTIFICATE This is to certify that Master ... HADI ABDULLA... of class XII C has completed his Computer Science Project during the academic year 2023-2024 at M.E.S Indian School Doha, Qatar and his project report is certified. Signature of Teacher In charge: ........cecsseseeee School Stamp: Roll Number/Registration Number Submitted for All India Senior School Certificate Practical Examination (Class XII) held at M.E.S Indian School, Doha-Qatar Internal Examiner External Examiner INaMC8rere cane s- case see dssasa easiest Name reece sees -naecneees Signature....c.cccccceceeeeeeees Signature....c.cccececcesceeee F265, Rev 0, Dated 11-Feb 2012 ACKNOWLEDGEMENT I would like to express my sincere gratitude to Mrs. Lijo Shibuson for her invaluable guidance, | . unwavering support, and insightful suggestions throughout the course of this project. Her expertise and encouragement have been instrumental in shaping the direction and quality of my research. ‘ I would also like to extend my heartfelt thanks to my parents for their constant encouragement, patience, ] and belief in my abilities. Their unwavering support and love have been my constant source of inspiration. Lastly, I would like to thank all the teachers and : classmates who have provided me with valuable insights and feedback during the course of this project. . This project would not have been possible without the collective support and encouragement from these individuals, and for that, I am truly grateful., >select * from index; ee) TOPICS Ce eee | 1 | INTRODUCTION | 2. | PYTHON | 2. | PYTHON SYSTEM REQUIREMENTS ee eee | 4 | MYSQL SYSTEM REQUIREMENTS | 5 | ADVANTAGES | 6 | DISADVANTAGES | 7 | REAL LIFE APPLICATIONS | 8 | FUNCTION HEADERS | 9 | SOURCE CODE | 10 | OUTPUT | 11 | LIMITATIONS OF PYTHON | 12 | LIMITATIONS OF MYSQL | 13 | CONCLUSION | 14 | BIBLIOGRAPHY Slt el alll all ll al alll alcatel alc a Ah GMRL INTRODUCTION / In today's fast-paced world, efficient management of everyday tasks is essential to maintain a well-organized and productive environment. One such indispensable aspect of daily life is laundry management. Whether it's in our homes, hostels, hotels, or laundromats, effective laundry management ensures that our clothes and textiles are kept clean, fresh, and ready for use. In this project, we will explore the key components of a laundry management system,our investigation will also cover topics such as database integration, real-time order status updates, payment processing, and delivery management. Through this comprehensive study, we aim to shed light on the significant impact of laundry management systems on the modern laundry industry. — “TEKH Python is a high-level, versatile, and ea unming language that has gained immense ity in the we of software development. It is a computer pro used to build websit tasks, and conduct data anal Python is a general-purpose language, meaning it can be used to create a variety of different programs and isn't specialized for any specific ge tts Created by Guido van Rossum and first released in 1991, Python is known for its simplicity, readability, and a rich ecosystem of libraries and frameworks that make it a powerful tool for a wide range of applications. PYTHON SYSTEM 00 sy ay ps aa cra ay eter eee as! a" ata) meas lan ge Ot i =] OM ge ts) ae OMe se (eC Ag MYS MySQL is a popular open-source relational database management system (RDBMS) known for its efficiency, reliability, and scalability. Developed by MySQL AB (now owned by Oracle Corporation), MySQL has become a widely adopted choice for managing and storing structured data in a variety of applications, from small-scale projects to large-scale enterprise solutions. MySQL is integral to many of the most popular software stacks for building and maintaining everything from ‘customer-facing web applications to powerful, data-driven B2B services. Its open- source nature, stability, and rich feature set, paired with ongoing development and support from Oracle, have meant that internet-critical organizations such as Facebook, Flickr, Twitter, Wikipedia, and YouTube all employ MySQL backends. ee Ce nome 84-bit a‘ Laer RC ay 4 ermal Pei gt 9 tT ) , eat Ae) eer] feat aca Pelee 4 Cee ge ee gs | mT LES ce Core is recommended) eg ag ele ete ee faked Resale) sls) a eee MOR Begs ag PRs Ns ON JY, ADVANTAGES RTC oe CaM Cent iemn nRtt SMe rca CMO Cenc RO On ystem simpli Oe LTT ystom oe Cora orde monitor the j and potential downtime during updates. User Training: Properly training staff to use the system effectively is crucial. Inadequate training can lead to mistakes, inefficiencies, and frustration among employees. Mee OND cea —— C7 i . Pee ai erect eee an igi manage ar a cay os ute sewn sO nt secitré platform for managing peti OUT E AES Ctty TS customer experiences and helps cerca DiSTssosme aan TT today's competitive market. . xe blcspyvoneeoninteract with pA ih “MySQU da s by extenting SOW cag : = fetchinea ney Emdgperforming actions. Renan, ‘updating, ent ile etn TSC Bae COO) OO PIE Python-MySQL connecti Hye an KeXerI 8 SIAC) SecA Co CeCe Peet ae ie OCR as ach GN, Don FLOW CHART Start: The process begins. fuser Leg tas It the useris-not logred Ny are pagmnpted 10.108 ces a system. checks the user's credentials) Jf the user x Phocks Tip vate Se ea Tot, return-to the SG NN e c RI f fb Reg Class: ie user om utara oa as ae ae er COnO BEINN cs items, status, and total amount. 3. ae eee Class: The ais : UETTASSS aie CuoiI LUNs Batten teco eta netS\ si ce Te . includes the following Fiat ies * Loading user data and Perera reatites een coe ¢ Creating a connection toa MySQL Reece to Ue ee nae oe Chie iy the (Piel oe . ge Cit and writing orders to Pecanienty ae : fuer cartes : : : BW item rerevieeenontertl Conus Not to perform rt Tens usu as oe eS sere or Kies oe to create_invoice(): Allows the user to create a new order by providing customer details, selecting urgency, service type, and specifying items with quantities. delete_order(): Enables the deletion of an order: from the list of orders. edit_order(): Allows for editing the items in an existing order. display_orders(): Displays a list of existing orders. order_status(): Updates the status of an existing Reo payment_and_delivery(): Manages payments and order delivery, but only for orders with specific statuses. display_price_menu(): Displays a price list of laundry items from the MySQL database. — “PEAT el iu ereate_laundry_items table: This function is responsible for creating a’ MySQL table named laundry items for , and washing prices. storing item names, ironing pric STEN Tom UIST MeSKi Cnc naTKon ENTS ecto) Cont GNnag ColesSI0 Mate) die * save_orders and load_orders functions: These functions save and load orders from a text file called “orders.txt.” This allows the program to persist orders across runs. ¢ validate phone number: This function cheeks if'a given phone number is in the correct format (8 digits). ¢ The script also includes a loop that ensures users must log in to use the system, After logging in, users can access the main menu for laundry ‘management operations. This code assumes that you have a MySQL database running locally with appropriaté credentials and a database named “project” set up for storing laundry item prices. It also expects a "orders.txt" file to store order data. Make sure to install the necessary Python packages (e.g., mysql-connector-python) and set up the MySQL database with the required table schema before running this code. SS TOEAIOF SOURCE CODE H#Modules used import re import mysql.connector class User: #User processing def __init__(self, username, password): self.username = username self.password = password class Order: #Order Data def __init__(self,phone_no ,customer_name ,urgent, service, items ,total_amount): self.phone_no = phone_no self .customer_name=customer_name self.urgent = urgent self.service = service self.items = items self.status = "Pending" total_amount = total_amount AP ELIOT Ah GML det maistraa (sel ts). return f£'''Phone: {self.phone_no} Name: {self£.customer_name} Urgent: {'Yes' if self.urgent else 'No'} Service: {self.service} Status: {self.status} Items: {self.items} Total: {self.total_amount:.2f} OR''' class LaundryManagementSystem: #Main Class def __ init__(self): self.current_user = None # Initialize the current user as None self.load_users() self.orders = [] self.load_orders() self.db_connection = mysql.connector.connect( host="localhost", user="root", password="root", database="project" ) self.create_laundry_items_table() AP ELIOTY Ah GMB #User def load_users(sel£): #User Data self.users = [User("hadi", "123"), User("avinash" “munnapro"), User("finan def login(self): #To begin login sequence username = input("Username: ") password = input("Password: ") user = next((user for user in self.users if = password), user.username == username and user.password None) if user: self.current_user = user print("Logged in successfully.") else: print("Invalid username or password.") def create_laundry_items_table(self):#Creating Price List cursor = self.db_connection.cursor() cursor .execute( CREATE TABLE IF NOT EXISTS laundry_items ( item_name VARCHAR(255) PRIMARY KEY, ironing_price DECIMAL(10, 2) washing_price DECIMAL(10, 2) ) ue) self.db_connection.commit() cursor.execute("SELECT COUNT(*) FROM laundry_items") result = cursor. fetchone() AP ELIOT Ah GMRL~ if result[0] == 0: items_data = [ (‘abaya', 10.00, 20.00), ('bedsheet', 6.00, 8.00), (‘blanket',15.00,15.00), ('cap',1.00,1.00), ('ghutrah', 3.00, 5.00), (‘hijab', 2.00, 5.00), (‘ladies dress', 10.00, 15.00), ('men suit', 6.00, 15.00), (‘military suit', 6.00, 15.00), (‘overall', 7.00, 15.00), ('pant', 3.00, 5.00), ('pillow cover', 2.00, 3.00), ('salwar', 2.00, 3.00), ('shawl', 3.00, 5.00), ('shirt', 3.00, 5.00), ('short', 2.00, 3.00), ('thobe', 3.00, 5.00), ('tie', 1.00, 2.00), ('towel', 3.00, 5.00), ('t shirt', 3.00, 5.00), (‘underwear', 2.00, 2.00), ('u shirt', 2.00, 2.00) ] cursor.executemany(" INSERT INTO laundry_items (item_name, ironing_price, washing_price) VALUES (%s, %s, %S)", items_data) self.db_connection.commit() cursor.close() PEL eS Spor Ah GML #Reading and Writing orders in file def save_orders(self): #Writing with open("orders.txt", "w") as file: for order in self.orders: file.write(£"{order.phone_no}, {order .customer_name}, {order.urgent}, {order.service}, {order.status},{order.total_amount}") for item in order.items: file.write(f£",{item[0]}, {item[1]}") file.write("\n") def load_orders(self): #Reading try: with open("orders.txt", "r") as file: for line in file: order_data = line.strip().split(',') phone_no, customer_name, urgent, service, status, total_amount = order_data[:6] urgent = True if urgent == "True" else False total_amount = float(total_amount ) items = [(order_data[i], float(order_data[i+1])) for i in range(6, len(order_data), 2)] self.orders.append(Order(phone_no, customer_name, urgent, service, items, total_amount)) except FileNotFoundError: self.orders = [] AP ELIOTY LGHV RL def main_menu(sel£): while True: print("\nMain Menu") print("1. Invoice") print("2. Delete Order") print("3. Edit Order") print("4. Display Orders") print("5. Order Status") print("6. Payment and Delivery") print("7. Price List") print("8. Exit") choice = input("Select an option: ") #Menu Driven Prégi if choice ls self.create_invoice() elif choice == '2': self.delete_order() elif choice == '3': self.edit_order() elif choice == '4': self.display_orders() elif choice == '5': self .order_status() elif choice == '6': self .payment_and_delivery() elif choice == '7': self .display_price_menu() elif choice == '8': print("Exiting the program.") break else: print("Invalid choice. Please select AP ELIOT AGM L def validate_phone_number(self, phone_no): #to check| phone number in valid format if re.match(r"4\d{8}$", phone_no): return True return False #CHOICES def create_invoice(self): #1 phone_no = input("Enter phone number (8 digits): ") if not self.validate_phone_number(phone_no): print("Invalid phone number format.") return customer_name = input("Enter customer name: " urgent = input("Is the order urgent? (y/n): ").lower() == 'y' service = input("Ironing or Washing? ").lower() items = [] total_amount = 0 PEEL eS Spor while True: item_name = input("Enter item name (or ‘done' to finish): ".lower()) if item_name ‘done': break item_quantity = int(input("Enter item quantity: ")) cursor = self.db_connection.cursor() cursor.execute("SELECT ironing_price, washing price FROM laundry items WHERE item_name = %s", (item_name, )) item_data = cursor. fetchone() cursor.close() if item_data is not None: ironing_price, washing_price = item_data items .append((item_name, item_quantity)) ironing_price = float(ironing_price) washing_price = float(washing_price) total_amount += (ironing price if roning" else washing_price) * service item_quantity else: print("Item not found in the AP ELIOT if urgent: total_amount*=2 order = Order(phone_no, customer_nam , urgent, service, items ,total_amount) self.orders.append(order ) self.save_orders() print("Order created successfully!") def delete_order(self): #2 self.display_orders() order_index = int(input("Enter the index of the order to delete: ")) if 0 < order_index <= len(self.orders): del self.orders[order_index-1] self.save_orders() print("Order deleted successfully!") else: print("Invalid index.") x AP ELIOT def edit_order(self): #3 self.display_orders() order_index = int(input("Enter the index of the order to edit: ")) if 0 < order_index <= len(self.orders): new_items = [] while True: item_name = input("Enter new item name (or 'done' to finish): ") if item_name.lower() == 'done': break item_quantity = float(input("Entey| new item quantity: ")) new_items.append((item_name, item_quantity)) self.orders[order_index-1].items = new_items self.save_orders() print("Order edited successfully!") else: print("Invalid index.") def display_orders(self): #4 print("\nOrders:") for index, order in enumerate(self.orders): print(£"\n{index+1}. {order}") AP ELIOTY def order_status(self): #5 self.display_orders() order_index = int(input("Enter the index of the order to update status: ")) if 0 < order_index <= len(self.orders): status = input("Enter new status (invoiced/washed/finished/racked): ") self.orders[order_index-1].status = status self.save_orders() print("Status updated successfully!") else: print("Invalid index.") def payment_and_delivery(self£): #6 self.display_orders() order_index = int(input("Enter the index of the order for payment and delivery: ")) i 0 < order_index <= len(self.orders): order = self.orders[order_index-1] if order.status in ["finished", "racked" payment = float(input("Enter payment amount: ")) order.status = "Delivered" self.save_orders() print("Payment received and order delivered!") else: print("Payment and delivery can only be done for orders with status 'finished' or 'racked'.") else: print("Invalid index.") PEM eS pow Ah GML def display_price_menu(self): #7 cursor = self.db_connection.cursor() cursor.execute("SELECT item_name, ironing_price, washing_price FROM laundry_items") price_menu = cursor. fetchall() cursor.close() print("\nPrice Menu:") print(" Item Name | Ironing Price | Washing Price ") print("-------------------------------- ee "y for item in price_menu: print(£"{item[0]:<13} | {item[1]: <15} | {item[2]:<15}") #Intializing Loop if _mame_ == "_main_": system = LaundryManagementSystem( ) while True: if system.current_user is None: print("Please log in to continue.") system. login() continue system.main_menu() — “eX ee Spor Ah GMRL OUTPUT Upon Executing Please log in to continue. Username: | On Login Please log in to continue. Username: hadi Password: 123 Logged in successfully. Main Menu 1. Invoice 2. Delete Order 3. Edit Order 4. Display Orders 5. Order Status 6. Payment and Delivery 7. Price List 8. Exit Select an option: | am ope fo "nf Ach GMRL 1.Invoicing Order Select an option: 1 Enter phone number (8 digits): 30370016 Enter customer name: aman Is the order urgent? (y/n): y Ironing or Washing? washing enter item name (or 'done' to finish): shirt Enter item quantity: 4 enter item name (or 'done' to finish): short Enter item quantity: 2 enter item name (or 'done' to finish): pant Enter item quantity: 3 enter item name (or 'done' to finish): done Order created successfully! Select an option: 1 Enter phone number (8 digits): 77906484 Enter customer name: nabil Is the order urgent? (y/n): n Ironing or Washing? ironing enter item name (or 'done' to finish): thobe Enter item quantity: 2 enter item name (or 'done' to finish): salwar Enter item quantity: 2 enter item name (or 'done' to finish): ghutrah Enter item quantity: 2 enter item name (or 'done' to finish): Order created successfully! done PEL pS pow Select an option: 1 Enter phone number (8 digits): 50138699 Enter customer name: hanana Is the order urgent? (y/n): n Troning or Washing? washing enter item name (or 'done' to finish): abaya Enter item quantity: 5 enter item name (or 'done' to finish): hijab Enter item quantity: 3 enter item name (or 'done' to finish): done Order created successfully! Select an option: 1 Enter phone number (8 digits): 77293422 Enter customer name: basith Is the order urgent? (y/n): n Ironing or Washing? ironing enter item name (or 'done' to finish): shirt Enter item quantity: 2 enter item name (or 'done' to finish): underwear Enter item quantity: 7 enter item name (or 'done' to finish): done Order created successfully! PEL ee Spe Ah GML 2.Deleting Order Main Menu 1. Invoice 2. Delete Order 3. Edit Order 4. Display Orders 5. Order Status 6. Payment and Delivery 7. Price List 8. Exit Select an option: 2 orders: 1. Phone: 30370016 Name: aman Urgent: Yes Service: washing Status: Pending Items: [('shirt', 4.0), (‘short', 2.0), (‘pant' Total: 82.00 QR 3.0)] 2. Phone: 77906484 Name: nabil Urgent: No Service: ironing Status: Pending Items: [('thobe', 2.0), (‘salwar', 2.0), (‘ghutrah', 2.0) Total: 16.00 QR 3. Phone: 50138699 Name: hanana Urgent: No Service: washing Status: Pending Items: [('abaya', 5.0), ("hijab', 3.0) Total: 115.00 OR 4. Phone: 77293422 Name: basith Urgent: No Service: ironing Status: Pending Items: [('shirt', 2.0), (‘underwear', 7.0) Total: 20.00 QR Enter the index of the order to delet PEL eS Spe Ah GML Enter the index of the order to delete Order deleted successfully! 3.Editing Order Main Menu 1. Invoice 2. Delete Order 3. Edit Order 4. Display Orders 5. Order Status 6. Payment and Delivery 7. Price List 8. Exit Select an option: 3 Orders: 1. Phone: 30370016 Name: aman Urgent: Yes Service: washing Status: Pending Items: [("shirt', 4.0), (‘short', 2.0), ('pant', 3.0) Total: 82.00 QR 2. Phone: 77906484 Name: nabil Urgent: No Service: ironing Status: Pending Items: [('thobe', 2.0), (‘salwar', 2.0), (‘ghutrah' Total: 16.00 QR 2.0)] 3. Phone: 50138699 Name: hanana Urgent: No Service: washing Status: Pending Items: [("abaya', 5.0), (‘hijab", 3.0) Total: 115.00 QR Enter the index of the order to edit: PEL ee Spe Ah GMRL he index of the order to edit: 3 ew item name (or 'done' to finish) ew item quantity: 1 ew item name (or 'done' to finish): done dited successfully! 4.Displaying Orders Main Menu 1. Invoice 2. Delete Order 3. Edit Order 4. Display Orders 5. Order tus 6. Payment and Delivery 7. Price List 8. Exit Select an option: 4 Orders: 1. Phone: 30370016 Name: aman Urgent: Yes Service: washing Status: Pending Items: [('shirt', 4.0), (‘short', 2.0), (‘pant', 3.0) Total: 82.00 QR wT Phone: 77906484 Name: nabil Urgent: No Service: ironing Status: Pending Items: [('thobe', 2.0), (‘salwar', 2.0), (‘ghutrah', 2.0) Total: 16.00 OR 3. Phone: 50138699 Name: hanana Urgent: No Service: washing Status: Pending Items: [(‘ladies dress', 1.0) Total: 15.00 QR PEL pS pow 5.Updating Status 1. Invoice 2. Delete Order 3. Edit Order 4. Display Orders 5. Order Status 6. Payment and Delivery 7. Price List 8. Exit Select an option: 5 Orders: 1. Phone: 30370016 Name: aman Urgent: Yes Servi washing Status: Pending Items: [('shirt', 4.0), (‘short', 2.0), (‘pant' Total: 82.00 OR 3.0)] 2. Phone: 77906484 Name: nabil Urgent: No Service: ironing Pending [('thobe', 2.0), (‘salwar', 2.0), (‘ghutrah', 2.0) 16.00 QR 3. Phone: 50138699 Name: hanana Urgent: No Service: washing Status: Pending Items: [(‘ladies dress', 1.0) Total: 15.00 OR Enter the index of the order to update status: | Enter the index of the order to update status: 1 Enter new status (invoiced/washed/finished/racked): racked] Status updated successfully! APETV Ah GML 6.Payment and Delivery Main Menu 1. Invoice 2. Delete order 3. Edit Order 4. Display Orders 5. Order Status 6. Payment and Delivery 7. Price Lis: 8. Exit Select an option: 6 Orders: 1. Phone: 30370016 Name: aman Urgent: Yes Service: washing Status: racked Items: [('shirt', 4.0), (‘short', 2.0), (‘pant', Total: 82.00 QR 3.0)] 2. Phone: 77906484 Name: nabil Urgent: No Service: ironing Status: Pending Items: [('thobe', 2.0), ('salwar', 2.0), (‘ghutrah', 2.0)] Total: 16.00 QR 3. Phone: 50138699 Name: hanana Urgent: No Service: washing Status: Pending Items: [('ladies dress', 1.0)] Total: 15.00 QR Enter the index of the order for payment and delivery: | Enter the index of the order for payment and deliver Enter payment amount: 82 Payment received and order delivered! PEL ee Spe Ah GML 7.Viewing Price List Main Menu 1. Invoice 2. Delete Order 3. Edit Order 4. Display Orders 5. Order Status 6. Payment and Delivery 7. Price List 8. Exit Select an option: 7 Price Menu: Item Name | Ironing Price | Washing Price I I bedsheet | 6.00 | 8.00 ghut rah | 3.00 | 5.00 hijab | 2.00 | 5.00 ladies dress | 10.00 | 15.00 men suit | 6.00 | 15.00 military suit | 6.00 | 15.00 overall | 7.00 | 15.00 pant | 3.00 | 5.00 pillow cover | 2.00 | 3.00 salwar | 2.00 | 3.00 shawl | 3.00 | 5.00 shirt | 3.00 | 5.00 short | 2.00 | 3.00 t shirt | 3.00 | 5.00 thobe | 3.00 | 5.00 tie | 1.00 | 2.00 towel | 3.00 | 5.00 u shirt | 2.00 | 2.00 I I underwear PEM eS pow AGM L 8.Exiting Program Main Menu 1. Invoice 2. Delete Order 3. Edit Order 4. Display Orders 5. Order Status 6. Payment and Delivery 7. Price List 8. Exit Select an option: 8 Exiting the program. * aah =. Be Cire teh Sa co ae eC BBLS CT) anni) Seana a can lead to unexpected behavior: Gnd errors. Additionally, Python is not a Pa choice for low-level system aarti Cae mia ee) Coy taveas oe) iC MeN eye Meena Ley TSO CACO Io LHe Vane ese NOONE Om: mitigated through the use of libraries and sis Trey ice ane) innoeatitans, Python offers many adv. a vast selection of LCF oMm alia Ly Siam aie Uae) san be easily integrated Nn; qe and ! tools, rt ? a While Python may have- limitations, it remains dowerful tool for developers who want to build ee ; oa ae elt) quickly and eres Na OO Ey meee) Eas " ant to-eyaluate your specific wy H bef ; TURBINE NAC IEVMD SVU UMNO AMOUMLRROM ICN Co S10) Wb) anDSS Cag residential communities and ay HCMC bolas artment complexes may use this OCU RCMITULY CRP INmr nett ta cr ties experience for residents. Tn Con@lusion, the Laundry Management Systemis a valuable asset in everyday life, bringing efficiency and organization to oars VMVDMURm eV ebeta betes cnt jest ou <.) ante ee = = aS E et “oad A (aka wi Y; ws 5 aes ‘ Sa VF = ell Z|

You might also like