Python help with loops please Using For.. loop, Write a program to fetch the nam
ID: 3711431 • Letter: P
Question
Python help with loops please
Using For.. loop, Write a program to fetch the name, salary and the state for 6 employees. Calculate the federal tax, state tax and the net salary for each employee. 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 WA calculate the state tax at 10% Otherwise calculate the state tax at 12% Calculate and display the netsalary.
def main():
salary = float(input('Enter salary: '))
federal_tax = 0.1 * salary
if salary > 100000:
federal_tax = 0.20 * salary
else:
federal_tax = 0.15 * salary
state_tax = 0.10 * salary
So far have this..
Explanation / Answer
Hi Dear,
Please find my code.
Output:
Enter name:pravesh kumar
Enter salary:4567
Enter state:California
Federal tax=685.05
State Tax=456.70
Net Salary=3425.25
Enter name:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.