Write a python program to enter employee detail from the user (name of employee,
designation and basic salary) and calculate the following: (HRA 10% OF BS, DA 90 % OF BS ,
TA 08% OF BS , CA 07 % OF BS, LIC 15% OF BS , PF 12% OF BS ) Gross Salary , Net
Salary and Annual Salary and calculate income tax by using the following format:
1 to 100000 = 0%
100000 to 200000 = 10%
200000 to 300000 = 15%
300000 to 400000 = 20%
>400000 = 25%
Answers
Answer:
Python Program to calculate the salary of an employee.
'''Calculate the Gross Salary of an employee for following allowance & deduction.
Get Basic Salary of Employee,
DA = 25% of Basic,
HRA = 15% of Basic,
PF = 12% of Basic,
TA = 7.50% of Basic.
Net Pay = Basic + DA + HRA + TA
Gross Pay = Net Pay - PF.
'''
print("SALARY PROGRAM")
name= str(input("Enter name of employee:"))
basic=float(input("Enter Basic Salary :"))
da=float(basic*0.25)
hra=float(basic*0.15)
pf=float((basic+da)*0.12)
ta=float(basic*0.075)
netpay=float(basic+da+hra+ta)
grosspay=float(netpay-pf)
print("\n\n")
print("S A L A R Y D E T A I L E D B R E A K U P ")
print("==============================================")
print(" NAME OF EMPLOYEE : ",name)
print(" BASIC SALARY : ",basic)
print(" DEARNESS ALLOW. : ",da)
print(" HOUSE RENT ALLOW.: ",hra)
print(" TRAVEL ALLOW. : ",ta)
print("==============================================")
print(" NET SALARY PAY : ",netpay)
print(" PROVIDENT FUND : ",pf)
print("==============================================")
print(" GROSS PAYMENT : ",grosspay)
print("==============================================")
Output
>>>
SALARY PROGRAM
Enter name of employee:NARENDRA
Enter Basic Salary :18500
S A L A R Y D E T A I L E D B R E A K U P
==============================================
NAME OF EMPLOYEE : NARENDRA
BASIC SALARY : 18500.0
DEARNESS ALLOW. : 4625.0
HOUSE RENT ALLOW.: 2775.0
TRAVEL ALLOW. : 1387.5
==============================================
NET SALARY PAY : 27287.5
PROVIDENT FUND : 2775.0
==============================================
GROSS PAYMENT : 24512.5
==============================================
Explanation:
code:-
days=float(input("Enter No Days Present:"))
wages=float(input("Enter wages per Day:"))
basic=wages*days;
HRA=basic*0.1;
DA=basic*0.05;
PF=basic*0.12;
netsalary=basic+HRA+DA-PF;
print("\nBasic:%lf \nHRA:%lf \nDA:%lf \nPF:%lf \nNet Salary:%lf" %(basic,HRA,DA,PF,netsalary));