1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Evgen [1.6K]
3 years ago
9

1. Write the Python code needed to perform the following:2. Calculate state withholding tax (stateTax) at 6.5 percent3. Calculat

e federal withholding tax (federalTax) at 28.0 percent.4. Calculate dependent deductions (dependentDeduction) at 2.5 percent of the employee’s salary for each dependent.5. Calculate total withholding (totalWithholding) as stateTax + federalTax+ dependentDeduction.6. Calculate take-home pay (takeHomePay) as salary- totalWithholding7. Execute the program by clicking the "Run Code" button at the bottom. You should get the following output:State Tax: $81.25Federal Tax: $350.00000000000006Dependents: $62.5Salary: $1250.0Take-Home Pay: $756.25In this program, the variables named salary and numDependents are initialized with the values 1250.0 and 2. To make this program more flexible, modify it to accept interactive input for salaryand numDependents.
Computers and Technology
1 answer:
Firdavs [7]3 years ago
3 0

Answer:

salary=float(input("Enter salary : "))

numDependents=int(input("Enter number of dependents : "))

stateTax=salary*0.065

federalTax=salary*0.28

dependentDeduction=salary*0.025*numDependents

totalWithholding=stateTax + federalTax+ dependentDeduction

takeHomePay=salary- totalWithholding

print("State Tax :$",str(stateTax))

print("Federal Tax :$",str(federalTax))

print("Dependents:$",str(dependentDeduction))

print("Salary :$",str(salary))

print("Take-Home Pay:$",str(takeHomePay))

Explanation:

  • Take the salary as input from user.
  • Take number of dependents as an input from user.
  • Calculate the state tax and Federal Tax. Then calculate the independent detection tax by multiplying salary with 0.025 as well as number of dependents.
  • After that calculate total withholding and then calculate home pay by subtracting total withholding from salary.
  • Finally print all the details.
You might be interested in
Compare userNumber with compareNumber and display 'Numbers are not equal' if the numbers are different. Then, display 'Variables
masya89 [10]

Answer:

Following are attached images that will help you understand the complete code. The code is tested with different variables and different outputs are obtained. All the necessary description is given in the form o comments inside the code.

Explanation:

3 0
3 years ago
Which of the following is the core communications protocol for the internet? telnet ftp tcp/ip ssl
inna [77]
Tcp/ip is the core communication protocol for the internet
4 0
3 years ago
What is the difference between ROM and RAM
Blababa [14]

Answer:

ROM : Read Only Memory.

RAM : Random Ascess Memory.

8 0
2 years ago
Read 2 more answers
. Create an abstract Dollar class with two integer attributes, both of which are non-public (Python programmers - it is understo
aksik [14]

Answer:

Explanation:

The following code is written in Java. It creates the abstract dollar class that has two instance variables for the dollars and the coins that are passed as arguments. The test output can be seen in the picture attached below.

class Dollar {

   int dollars;

   double coin;

   private Dollar(int dollar, int coin) {

       this.dollars = dollar;

       this.coin = Double.valueOf(coin) / 100;

   }

   

}

4 0
2 years ago
The size of an array (how many elements it contains), which is accessed by .Lenth() returns (Choose the best answer)
Wewaii [24]

Answer:that creates the array, puts some values in it, and displays the values. ... assign a value to each array element and print for (int i = 0; i < anArray.length; i++) ... Array; Array Initializers; Accessing an Array Element; Getting the Size of an Array ... not create an array and does not allocate any memory to contain array elements.

Explanation:

5 0
3 years ago
Other questions:
  • Suppose two hosts, A and B, are separated by 15,000 kilometers and are connected by a direct link of R = 5 Mbps. Suppose the pro
    11·1 answer
  • Your browsing the Internet and realize your browser is not responding which of the following will allow you to immediately exit
    14·2 answers
  • If you filmed a clip in 120fps, how many frames are in a seconds of video.
    13·1 answer
  • A red wavy line under a word means _____. a change has been made in the text a new word was inserted in the document there is a
    11·2 answers
  • What is contrast (in Photography)?
    14·1 answer
  • Fill in the blank with the correct response.
    10·1 answer
  • A digital designer might do computer animations for video games,<br> OA<br> True<br> OB<br> False
    12·2 answers
  • A group of students writes their names and unique student ID numbers on sheets of paper. The sheets are then randomly placed in
    15·1 answer
  • Ways to be your best digital self?
    7·1 answer
  • Please help This is a homework in ICT class
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!