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
==============================================
>>> 


No comments

Post your comments

Powered by Blogger.