[go: up one dir, main page]

0% found this document useful (0 votes)
184 views1 page

Salaryconditional

The document describes a Python program that takes an employee's basic salary as input and calculates their gross salary based on Dearness Allowance (DA) and House Rent Allowance (HRA) percentages that vary depending on the basic salary amount. The program uses if/elif statements to determine the correct DA and HRA rates, calculates each amount, and prints the output.

Uploaded by

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

Salaryconditional

The document describes a Python program that takes an employee's basic salary as input and calculates their gross salary based on Dearness Allowance (DA) and House Rent Allowance (HRA) percentages that vary depending on the basic salary amount. The program uses if/elif statements to determine the correct DA and HRA rates, calculates each amount, and prints the output.

Uploaded by

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

2.

Write a python program to input the basic salary of an employee and calculate
its Gross salary according to the following:
(DA or dearness allowance is calculated as a specific percentage of the basic
salary
which is then added to the basic salary along with other components like HRA (House
Rent Allowance)
to make up the total salary of an employee of the government sector.)

Basic Salary <= 10000 : HRA = 20%, DA = 80%


Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
Ans:
Basic_Salary = int(input("Enter the basic salary : Rs."))

if Basic_Salary <= 10000 :

HRA = (20/100)*Basic_Salary
DA = (80/100)*Basic_Salary

elif Basic_Salary <= 20000 :

HRA = (25/100)*Basic_Salary
DA = (90/100)*Basic_Salary

elif Basic_Salary > 20000 :

HRA = (30/100)*Basic_Salary
DA = (95/100)*Basic_Salary

Gross_Salary = Basic_Salary + HRA + DA


print ("Dearness Allowance of Basic Salary :" , DA)
print ("House Rent of Basic Salary :" , HRA)
print ("Gross Salary :" , Gross_Salary)

You might also like