Answer to Question #274024 in Python for Varsha Barui

Question #274024

In a company an employee is paid as under: If his basic salary is less than 30,000, then HRA= 10% of his basic salary and DA = 90% of his basic salary. If his salary is either equal or above Rs 30, 000, then HRA=500, and DA = 98% of basic Salary. If the employee's salary is input through the keyboard , Write a program to find the gross salary.

1
Expert's answer
2021-12-01T06:40:53-0500


SOLUTION CODE


basic_salary = float(input("\nPlease Entered Basic Salary (In Rs.)"))
if basic_salary < 30000:
    hra = basic_salary * (10 / 100)
    da = basic_salary * 90 / 100;

else:
    hra = 500;
    da = basic_salary * 98 / 100;

gross_salary = basic_salary + hra + da;
print("\nBasic Salary = Rs "+str(basic_salary))
print("HRA  = Rs "+ str(hra));
print("DA  = Rs "+str(da))
print("Gross salary = Rs "+str(gross_salary))

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