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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter3: Input/output
Section: Chapter Questions
Problem 4PE: 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and...
icon
Related questions
Question
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.

Expert Solution
Step 1: Algorithm:

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

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr