0% found this document useful (0 votes)
10 views14 pages

Avika

This document is a project report for a Computer Science class at PM SHRI Kendriya Vidyalaya No-2 Armapur, Kanpur. It includes a certification of project completion, a declaration of originality, acknowledgments, and outlines the hardware and software requirements for a Restaurant Management System and a Weight Converter application developed using Python and Tkinter. The report also contains code snippets for both applications, detailing their functionalities and user interface.

Uploaded by

pigapgigap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views14 pages

Avika

This document is a project report for a Computer Science class at PM SHRI Kendriya Vidyalaya No-2 Armapur, Kanpur. It includes a certification of project completion, a declaration of originality, acknowledgments, and outlines the hardware and software requirements for a Restaurant Management System and a Weight Converter application developed using Python and Tkinter. The report also contains code snippets for both applications, detailing their functionalities and user interface.

Uploaded by

pigapgigap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

PM SHRI KENDRIYA VIDYALAYA NO-2 ARMAPUR

KANPUR

A Project Report
on
……………………………….

Submitted in Partial Fulfillment for Class XI (Session 2024-25)


Subject: COMPUTER SCIENCE (083)

Submitted By:

Name:… … … … … … …
.

Roll No: … … … … … …
Under the Guidance of:

Mr. Ashok Uttam


PGT(CS)
Certificate

This is certify that …………………. of class

11th has submitted his/her Computer Science(083)


project. He/She has taken proper care and
sincerity in completion of his/her project. I certify
that this project is up to my expectations and as per
the guidelines issued by the CBSE.

Ashok Uttam
PGT(CS)
Declaration
I hereby declare that the project REPORT entitled
“……………………………………………
……….” submitted to department of computer
science, PM SHRI KV No2 Armapur, Kanpur is
prepared by me. All the coding and project report
is original and our personal effort.

Name:
………………………….

Roll
No:… … … … … … … … …
ACKNOWLEDGEMET

Primarily I would thanks to my computer teacher Mr.

Ashosk Uttam, PGT(CS) whose valuable guidance has been


helped
me to choose this project and make it full proof success. His
suggestions and his instructions has served as the major
contributor towards the completion of project. Then I would

like to thanks my parents who helped me with their valuable


ideas and guidance which has helpful in various phase of the
completion of the project. I would also like to thanks Mr. S K L
Varnwall, our Principal sir, who has provided the excellent
environment and infrastructure in Vidyalaya to complete my
project.
Name:
………………………..
Roll No:
……………………

CONTENTS
Requirement
● Hardware
Requirement
1. CPU- intel/AMD
2. RAM- Minimum 2
GB
3. HDD/SSD-512GB

● Software
Requirement
1. Python IDLE
import tkinter as tk
from tkinter import messagebox

class RestaurantManagementSystem:
def __init__(self, root):
self.root = root
self.root.title("Restaurant Management System")

self.customer_name = tk.StringVar()
self.customer_contact = tk.StringVar()

self.items = {
"Burger": 49,
"Pizza": 199,
"Pasta": 159,
"Sandwich": 80,
"Salad": 90
}

self.orders = {}

self.gst_percentage = 18

self.create_gui()

def create_gui(self):
details_frame = tk.LabelFrame(self.root, text="Customer Details")
details_frame.pack(fill="x", padx=10, pady=10)

name_label = tk.Label(details_frame, text="Name:")


name_label.grid(row=0, column=0, padx=5, pady=5, sticky="e")
name_entry = tk.Entry(details_frame,
textvariable=self.customer_name)
name_entry.grid(row=0, column=1, padx=5, pady=5, sticky="w")

contact_label = tk.Label(details_frame, text="Contact:")


contact_label.grid(row=1, column=0, padx=5, pady=5, sticky="e")
contact_entry = tk.Entry(details_frame,
textvariable=self.customer_contact)
contact_entry.grid(row=1, column=1, padx=5, pady=5, sticky="w")
contact_entry.configure(validate="key")

contact_entry.configure(validatecommand=(contact_entry.register(self.va
lidate_contact), "%P"))

menu_frame = tk.LabelFrame(self.root, text="Menu")


menu_frame.pack(fill="both", expand=True, padx=10, pady=10)

item_header = tk.Label(menu_frame, text="Items")


item_header.grid(row=0, column=0, padx=5, pady=5, sticky="w")
quantity_header = tk.Label(menu_frame, text="Quantity")
quantity_header.grid(row=0, column=1, padx=5, pady=5,
sticky="w")

row = 1
for item, price in self.items.items():
item_var = tk.IntVar()
item_label = tk.Label(menu_frame, text=f"{item} -
{self.convert_to_inr(price)}")
item_label.grid(row=row, column=0, padx=5, pady=5, sticky="w")

quantity_entry = tk.Entry(menu_frame, width=5)


quantity_entry.grid(row=row, column=1, padx=5, pady=5,
sticky="w")

self.orders[item] = {"var": item_var, "quantity": quantity_entry}

row += 1

buttons_frame = tk.Frame(self.root)
buttons_frame.pack(fill="x", padx=10, pady=10)

print_bill_button = tk.Button(buttons_frame, text="Print Bill",


command=self.show_bill_popup)
print_bill_button.pack(side="left", padx=5)

past_record_button = tk.Button(buttons_frame, text="Past


Records", command=self.past_records)
past_record_button.pack(side="left", padx=5)

clear_selection_button = tk.Button(buttons_frame, text="Clear


Selection", command=self.clear_selection)
clear_selection_button.pack(side="left", padx=5)

self.sample_bill_text = tk.Text(self.root, height=10)


self.sample_bill_text.pack(fill="x", padx=10, pady=10)

# Update sample bill when quantity or item is selected


for item, info in self.orders.items():
info["quantity"].bind("<FocusOut>", lambda event, item=item:
self.update_sample_bill(item))
info["quantity"].bind("<Return>", lambda event, item=item:
self.update_sample_bill(item))
info["quantity"].bind("<KeyRelease>", lambda event, item=item:
self.update_sample_bill(item))
info["var"].trace("w", lambda *args, item=item:
self.update_sample_bill(item))

def show_bill_popup(self):
# Check if customer name is provided
if not self.customer_name.get().strip():
messagebox.showwarning("Warning", "Please enter customer
name.")
return

selected_items = []
total_price = 0

for item, info in self.orders.items():


quantity = info["quantity"].get()
if quantity:
selected_items.append((item, int(quantity)))
total_price += self.items[item] * int(quantity)

if not selected_items:
messagebox.showwarning("Warning", "Please select at least one
item.")
return

gst_amount = (total_price * self.gst_percentage) / 100

bill = f"Customer Name: {self.customer_name.get()}\n"


bill += f"Customer Contact: {self.customer_contact.get()}\n\n"
bill += "Selected Items:\n"
for item, quantity in selected_items:
bill += f"{item} x {quantity} - {self.convert_to_inr(self.items[item] *
quantity)}\n"
bill += f"\nTotal Price: {self.convert_to_inr(total_price)}\n"
bill += f"GST ({self.gst_percentage}%):
{self.convert_to_inr(gst_amount)}\n"
bill += f"Grand Total: {self.convert_to_inr(total_price +
gst_amount)}"

messagebox.showinfo("Bill", bill)

def past_records(self):
messagebox.showinfo("Past Records", "This feature is not
implemented yet.")

def clear_selection(self):
for item, info in self.orders.items():
info["var"].set(0)
info["quantity"].delete(0, tk.END)

def update_sample_bill(self, item):


selected_items = []
total_price = 0
for item, info in self.orders.items():
quantity = info["quantity"].get()
if quantity:
selected_items.append((item, int(quantity)))
total_price += self.items[item] * int(quantity)

gst_amount = (total_price * self.gst_percentage) / 100

bill = f"Customer Name: {self.customer_name.get()}\n"


bill += f"Customer Contact: {self.customer_contact.get()}\n\n"
bill += "Selected Items:\n"
for item, quantity in selected_items:
bill += f"{item} x {quantity} - {self.convert_to_inr(self.items[item] *
quantity)}\n"
bill += f"\nTotal Price: {self.convert_to_inr(total_price)}\n"
bill += f"GST ({self.gst_percentage}%):
{self.convert_to_inr(gst_amount)}\n"
bill += f"Grand Total: {self.convert_to_inr(total_price +
gst_amount)}"

self.sample_bill_text.delete("1.0", tk.END) # Clear previous


contents
self.sample_bill_text.insert(tk.END, bill)

def validate_contact(self, value):


return value.isdigit() or value == ""

@staticmethod
def convert_to_inr(amount):
return "₹" + str(amount)

root = tk.Tk()
restaurant_system = RestaurantManagementSystem(root)
root.mainloop()
import tkinter as tk
from tkinter import ttk

# Function to convert weight


def convert_weight():
try:
weight = float(weight_entry.get()) # Get input weight
unit = unit_var.get() # Get selected unit

if unit == "Kilograms":
kg = weight
g = weight * 1000
lbs = weight * 2.20462
oz = weight * 35.274
elif unit == "Grams":
kg = weight / 1000
g = weight
lbs = weight * 0.00220462
oz = weight * 0.035274
elif unit == "Pounds":
kg = weight / 2.20462
g = kg * 1000
lbs = weight
oz = weight * 16
elif unit == "Ounces":
kg = weight / 35.274
g = kg * 1000
lbs = weight / 16
oz = weight

# Update labels with converted values


result_var.set(f"Kilograms: {kg:.2f} kg\nGrams: {g:.2f} g\nPounds:
{lbs:.2f} lbs\nOunces: {oz:.2f} oz")

except ValueError:
result_var.set("Please enter a valid number.")
# GUI Setup
root = tk.Tk()
root.title("Weight Converter")
root.geometry("350x300")

# Input Field
tk.Label(root, text="Enter Weight:").pack()
weight_entry = tk.Entry(root)
weight_entry.pack()

# Dropdown Menu for Unit Selection


unit_var = tk.StringVar(value="Kilograms")
unit_menu = ttk.Combobox(root, textvariable=unit_var,
values=["Kilograms", "Grams", "Pounds", "Ounces"])
unit_menu.pack()

# Convert Button
convert_btn = tk.Button(root, text="Convert", command=convert_weight)
convert_btn.pack(pady=10)

# Result Display
result_var = tk.StringVar()
tk.Label(root, textvariable=result_var, fg="blue", font=("Arial", 12)).pack()

root.mainloop()

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