Skip to main content

How to Calculate Salary of Employee with Taxable Amount in Python


Body

This is a simple program to calculate salary of employee with taxable amount in Python.

The program requires the name of the employee, name of the company, salary of the employee.

It will then calculate based on 20% tax rate. If the employee’s salary falls below 10,000, then the employee is not taxed. Else the employee is taxed with 20% deduction.

  1. emp_name = input("Enter the name of the Employee: \n")
  2. comp_name = input("Enter the company name: \n")
  3. salary = float(input("Enter the salary of the Employee: \n"))
  4.  
  5. if (salary > 10000):
  6. tax = 0.20 * salary
  7. net_salary = salary - tax
  8.  
  9. print("The net salary of " + emp_name+" in " + comp_name + " is", net_salary)
  10. else:
  11. net_salary = salary
  12.  
  13. print("Salary is not Taxable")
  14. print("The Net salary of " + emp_name + " in " + comp_name + " is ", salary)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.