Answer to Question #230208 in Python for Mansi

Question #230208
In a company if an employee is paid as under: If his basic salary is less than Rs. 1500, then HRA=10% of basic salary and DA=90% of basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the employee's salary is input through the keyboard write a program to find his gross salary.
1
Expert's answer
2021-08-27T07:25:03-0400
#If the employee's salary is input through
#the keyboard write a program to find his gross salary.
basicSalar=float(input("Enter basic salar Rs.: "))
#If his basic salary is less than Rs. 1500,
#then HRA=10% of basic salary and DA=90% of basic salary.
if basicSalar<1500:
    HRA=0.1*basicSalar
    DA=0.9*basicSalar
#If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500
#and DA = 98% of basic salary.
elif basicSalar>=1500:
    HRA=500
    DA=0.98*basicSalar
grossSalary=basicSalar+HRA+DA
print(f"Gross Salary: Rs. {grossSalary}")





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS