C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
Bartleby Related Questions 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
Check Mark
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

Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L