New Green Field School
New Green Field School
Informatics Practices
Project on
❖ ACKNOWLEDGMENT
❖ CERTIFICATE
❖ PREFACE
❖ MODULES USED
❖ METHODOLOGY / SYNOPSIS
❖ CODING
❖ OUTPUT
❖ BIBLIOGRAPHY
ACKNOWLDEGEMENT
SOHAM CHOUDHARY
XII-F
COMMERCE
CERTIFICATE
Ms. Sucheta
(Informatics Practices)
PREFACE
Software Requirements –
# File paths
customer_file = 'customer.csv'
bill_file = 'bill.csv'
# Fields
customer_fields = ['cust_id', 'name', 'address', 'phone', 'units',
'category']
bill_fields = ['cust_id', 'base_rate', 'fixed_charge', 'tax_percent',
'other_charge', 'total_bill']
# data
customers = [
['C101', 'Soham', 'Delhi', '99716023227', 230, 'Domestic'],
['C102', 'Anjali Mehra', 'Mumbai', '9123456789', 180,
'Commercial'],
['C103', 'Sameer Khan', 'Hyderabad', '9012345678', 120,
'Domestic'],
['C104', 'Priya Sharma', 'Chennai', '9988776655', 300,
'Industrial'],
['C105', 'Aman Verma', 'Kolkata', '9871234567', 150,
'Domestic'],
['C106','Rajesh','Uttar Pradesh','9871234535 ',120,'Domestic']
]
bills = []
if category == 'Domestic':
rate = 7
tax = 5
fixed = 50
other = 30
elif category == 'Commercial':
rate = 9
tax = 12
fixed = 100
other = 50
else:
rate = 11
tax = 18
fixed = 200
other = 75
if cust_id in df['cust_id'].values:
# Billing
if category == 'Domestic':
rate = 7
tax = 5
fixed = 50
other = 30
elif category == 'Commercial':
rate = 9
tax = 12
fixed = 100
other = 50
else:
rate = 11
tax = 18
fixed = 200
other = 75
# Update Customer
def update_customer():
df = pd.read_csv(customer_file)
bdf = pd.read_csv(bill_file)
if idx.empty:
if category == 'Domestic':
rate = 7
tax = 5
fixed = 50
other = 30
elif category == 'Commercial':
rate = 9
tax = 12
fixed = 100
other = 50
else:
rate = 11
tax = 18
fixed = 200
other = 75
base = units * rate
total = base + fixed + other + (base * tax / 100)
df.to_csv(customer_file, index=False)
bdf.to_csv(bill_file, index=False)
# Delete Customer
def delete_customer():
df = pd.read_csv(customer_file)
bdf = pd.read_csv(bill_file)
if cust_id in df['cust_id'].values:
df = df[df['cust_id'] != cust_id]
bdf = bdf[bdf['cust_id'] != cust_id]
df.to_csv(customer_file, index=False)
bdf.to_csv(bill_file, index=False)
if sub == '1':
# Statistics
def statistics():
df = pd.read_csv(customer_file)
print("Columns:", df.columns.tolist())
print("Shape:", df.shape)
print("Data Types:\n", df.dtypes)
print("Summary:\n", df.describe())
# Data Visualization
def visualize():
df = pd.read_csv(customer_file)
plt.bar(df['cust_id'], df['units'], color='green')
plt.xlabel("Customer ID")
plt.ylabel("Units Consumed")
plt.title("Electricity Usage per Customer")
plt.show()
# Menu
def menu():
init_files()
while True:
print("\n====== Electricity Bill System ======")
print("1. Add Customer")
print("2. Update Customer")
print("3. Delete Customer")
print("4. View All Customers")
print("5. View Bill")
print("6. View Statistics")
print("7. Data Visualization")
print("8. Exit")
# Run
menu()
OUTPUT
Main Screen
Add Customer
Update Customer
Delete Customer
View Customer
View Bill
View Statistics
Data Visualization
View Top 5 Customers
View Bottom 5 Customers
Details of Specific Customer
Return to Main Menu
BIBLIOGRAPHY
❖ https://www.google.com/