NETSALARY Using only conditional statements and loops in Python, Write a program to ask for the name, salary and the state for 6 employees. Calculate the federal tax, state tax and the net salary for each employee. DO NOT USE FUNCTIONS. Use the following criteria: To calculate the federal tax, use the following criteria: If the salary is greater than 100,000 then calculate the federal tax at 20 percent. Otherwise calculate the federal tax at 15%. To calculate the state Tax, use the following criteria: If the employee is from CA, NV, AZ, or TX calculate the state tax at 10% Otherwise calculate the state tax at 12% Calculate and display the netsalary. Calculate the display the net salary of the employee. To calculate the net salary, subtract federal and state tax from the gross salary.
Calculate the display the net salary of the employee. To calculate the net salary, subtract federal and state tax from the gross salary.
Step-1: Start
Step-2: Start loop for i in range(6)
Step-2.1: Print "Employee {i + 1}"
Step-2.2: Declare variable name and take input from the user
Step-2.3: Declare variable salary and take input from the user
Step-2.4: Declare variable state and take input from the user
Step-2.5: If salary is greater than 100000
Step-2.5.1: Declare variable federal_tax and assign 0.20 * salary
Step-2.6: Else In federal_tax assign 0.15 * salary
Step-2.7: If state in ("CA", "NV", "AZ", "TX")
Step-2.7.1: Declare variable state_tax and assign 0.10 * salary
Step-2.8: Else In state_tax assign 0.12 * salary
Step-2.9: Declare variable net_salary and assign salary - federal_tax - state_tax
Step-2.10: Print federal_tax
Step-2.11: Print state_tax
Step-2.12: Print net_salary
Step-3: Stop
Step by step
Solved in 4 steps with 3 images