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

Employee Salary Management System

Uploaded by

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

Employee Salary Management System

Uploaded by

ahannaajith88
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SOURCE CODE:

def empdata(): employees = {} n=


int(input("Enter no. of employees : "))
for i in range(n):

name = input("Enter employee's name = ") salary =


float(input("Enter employee's salary = ")) allowance =
float(input("Enter employee's allowance = ")) deductions =
float(input("Enter employee's deductions = "))
employees[name] = [salary, allowance, deductions] return
employees def totalsalary(employees):
total = 0

for emp in [Link]():

total = total + emp[0]


print("Total salary =", total) def
allowancededuction(employees):

totala = 0
totald = 0
for emp in [Link]():
totala = totala + emp[1] totald
= totald + emp[2] print("Total
allowance =", totala) print("Total
deductions =", totald) def
search(employees):
search = input("Enter employee to search = ")
if search in employees: emp =
employees[search] print("Employee
Found!") print("Name :", search)
print("Salary :", emp[0]) print("Allowance :",
emp[1]) print("Deductions :", emp[2])
else:
print("Employee not
found!") employees = empdata()
while True:
print("""Operations Menu :-

1. Display the total salary.


2. Display total allowance and deductions.
3. Search for an employee. 4. Exit""") ch = int(input("Enter your choice = "))

if ch == 1:

totalsalary(employees)

elif ch == 2:
allowancededuction(employees)
elif ch == 3:
search(employees)
elif ch == 4: break
else: print("Invalid
choice!")

You might also like