0% found this document useful (0 votes)
4 views2 pages

Hostel Mess Management System

Uploaded by

thingsforuonly
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)
4 views2 pages

Hostel Mess Management System

Uploaded by

thingsforuonly
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

22/11/2025, 14:52 Python Project - Colab

# Mess Management System for Hostel

students = {}

def add_student():
roll = input("Enter Roll Number: ")
name = input("Enter Student Name: ")
students[roll] = {"name": name, "attendance": 0, "extras": 0}
print("Student added successfully!\n")

def mark_attendance():
roll = input("Enter Roll Number: ")
if roll in students:
students[roll]["attendance"] += 1
print("Attendance marked!\n")
else:
print("Student not found!\n")

def add_extra_items():
roll = input("Enter Roll Number: ")
if roll in students:
amt = float(input("Enter extra amount: "))
students[roll]["extras"] += amt
print("Extra amount added!\n")
else:
print("Student not found!\n")

def generate_bill():
mess_rate = 80 # per meal/day
print("\n----- Monthly Mess Bill -----")
for roll, data in [Link]():
bill = data["attendance"] * mess_rate + data["extras"]
print(f"{data['name']} ({roll}) → Rs. {bill}")
print("------------------------------\n")

while True:
print("1. Add Student")
print("2. Mark Attendance")
print("3. Add Extra Items")
print("4. Generate Bill")
print("5. Exit")

choice = input("Enter your choice: ")

if choice == "1":
add_student()
elif choice == "2":
mark_attendance()
elif choice == "3":
add_extra_items()
elif choice == "4":
generate_bill()
elif choice == "5":
print("Exiting system...")
break
else:
print("Invalid choice!\n")

1. Add Student
2. Mark Attendance
3. Add Extra Items
4. Generate Bill
5. Exit
Enter your choice: 1
Enter Roll Number: 101
Enter Student Name: Vaishnavi Jain
Student added successfully!

1. Add Student
2. Mark Attendance
3. Add Extra Items
4. Generate Bill
5. Exit
Enter your choice: 2
Enter Roll Number: 101
Attendance marked!

1. Add Student
2. Mark Attendance
3. Add Extra Items
4. Generate Bill
5. Exit

[Link] 1/2
22/11/2025, 14:52 Python Project - Colab
Enter your choice: 3
Enter Roll Number: 101
Enter extra amount: 50
Extra amount added!

1. Add Student
2. Mark Attendance
3. Add Extra Items
4. Generate Bill
5. Exit
Enter your choice: 4

----- Monthly Mess Bill -----


Vaishnavi Jain (101) → Rs. 130.0
------------------------------

1. Add Student
2. Mark Attendance
3. Add Extra Items
4. Generate Bill
5. Exit
Enter your choice:

[Link] 2/2

You might also like