0% found this document useful (0 votes)
2 views15 pages

polio (1)

This document is a project report for a Computer Science class at PM SHRI Kendriya Vidyalaya No-2 Armapur, Kanpur, submitted by a student under the guidance of Mr. Ashok Uttam. It includes sections on project introduction, requirements, dataset analysis, coding with output, and acknowledgments. The project involves a Restaurant Management System and a Student Report Card application, both implemented using Python and Tkinter.

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)
2 views15 pages

polio (1)

This document is a project report for a Computer Science class at PM SHRI Kendriya Vidyalaya No-2 Armapur, Kanpur, submitted by a student under the guidance of Mr. Ashok Uttam. It includes sections on project introduction, requirements, dataset analysis, coding with output, and acknowledgments. The project involves a Restaurant Management System and a Student Report Card application, both implemented using Python and Tkinter.

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/ 15

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
1.​Introduction of the
Project
2.​Requirement
●​ Hardware
Requirement
●​ Software
Requirement
3.​Brief Overview of Python Pandas
4.​About Dataset used
5.​Analysis of dataset
6.​Coding with Output
7.​Conclusion
8.​Bibliography
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 messagebox, Toplevel
import csv

# Function to calculate and display the report card on a second page


def calculate_report():
try:
name = name_entry.get()
roll_no = roll_entry.get()
marks = [int(math_entry.get()), int(physics_entry.get()),
int(chemistry_entry.get()), int(cs_entry.get()), int(english_entry.get())]

total_marks = sum(marks)
percentage = total_marks / 5
grade = "A+" if percentage >= 90 else "A" if percentage >= 80 else
"B" if percentage >= 70 else "C" if percentage >= 60 else "D" if
percentage >= 50 else "F"

# Open a new window to display the result along with buttons


result_window = Toplevel(root)
result_window.title("Report Card")
result_window.geometry("350x400")
result_window.config(bg="light blue")

tk.Label(result_window, text="Student Report Card", font=("Arial",


14, "bold"), bg="light blue").pack(pady=5)
tk.Label(result_window, text=f"Student Name: {name}",
font=("Arial", 12), bg="light blue").pack()
tk.Label(result_window, text=f"Roll Number: {roll_no}", font=("Arial",
12), bg="light blue").pack()
tk.Label(result_window, text=f"Mathematics: {marks[0]}",
font=("Arial", 12), bg="light blue").pack()
tk.Label(result_window, text=f"Physics: {marks[1]}", font=("Arial",
12), bg="light blue").pack()
tk.Label(result_window, text=f"Chemistry: {marks[2]}", font=("Arial",
12), bg="light blue").pack()
tk.Label(result_window, text=f"Computer Science: {marks[3]}",
font=("Arial", 12), bg="light blue").pack()
tk.Label(result_window, text=f"English: {marks[4]}", font=("Arial",
12), bg="light blue").pack()
tk.Label(result_window, text=f"Total Marks: {total_marks}",
font=("Arial", 12), bg="light blue").pack()
tk.Label(result_window, text=f"Percentage: {percentage:.2f}%",
font=("Arial", 12), bg="light blue").pack()
tk.Label(result_window, text=f"Grade: {grade}", font=("Arial", 12,
"bold"), fg="blue", bg="light blue").pack()

# Buttons inside result window


tk.Button(result_window, text="Save Report",
command=save_report, font=("Arial", 10, "bold"),
bg="white").pack(pady=10)

except ValueError:
messagebox.showerror("Input Error", "Please enter valid marks
(0-100).")

# Function to save report card to CSV file


def save_report():
try:
name = name_entry.get()
roll_no = roll_entry.get()
marks = [math_entry.get(), physics_entry.get(),
chemistry_entry.get(), cs_entry.get(), english_entry.get()]
total_marks = sum([int(m) for m in marks])
percentage = total_marks / 5
grade = "A+" if percentage >= 90 else "A" if percentage >= 80 else
"B" if percentage >= 70 else "C" if percentage >= 60 else "D" if
percentage >= 50 else "F"

with open("student_records.csv", "a", newline="") as file:


writer = csv.writer(file)
writer.writerow([name, roll_no, *marks, total_marks,
f"{percentage:.2f}%", grade])
messagebox.showinfo("Success", "Student Report Saved
Successfully!")

except ValueError:
messagebox.showerror("Error", "Please enter valid data before
saving.")

# GUI Setup
root = tk.Tk()
root.title("Student Report Card")
root.geometry("400x500")
root.config(bg="light blue")

# Title Label
tk.Label(root, text="Student Report Card", font=("Arial", 16, "bold"),
bg="light blue").pack(pady=10)

tk.Label(root, text="Student Name:", bg="light blue").pack()


name_entry = tk.Entry(root)
name_entry.pack()

tk.Label(root, text="Roll Number:", bg="light blue").pack()


roll_entry = tk.Entry(root)
roll_entry.pack()

tk.Label(root, text="Enter Marks (out of 100)", bg="light blue",


font=("Arial", 10, "bold")).pack(pady=5)

tk.Label(root, text="Mathematics:", bg="light blue").pack()


math_entry = tk.Entry(root)
math_entry.pack()

tk.Label(root, text="Physics:", bg="light blue").pack()


physics_entry = tk.Entry(root)
physics_entry.pack()
tk.Label(root, text="Chemistry:", bg="light blue").pack()
chemistry_entry = tk.Entry(root)
chemistry_entry.pack()

tk.Label(root, text="Computer Science:", bg="light blue").pack()


cs_entry = tk.Entry(root)
cs_entry.pack()

tk.Label(root, text="English:", bg="light blue").pack()


english_entry = tk.Entry(root)
english_entry.pack()

# Button Frame for better alignment


button_frame = tk.Frame(root, bg="light blue")
button_frame.pack(pady=10)

tk.Button(button_frame, text="Calculate Report",


command=calculate_report, font=("Arial", 10, "bold"),
bg="white").pack(side="left", padx=10)

# Start GUI loop


root.mainloop()

You might also like