Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write the Java Code needed to perform the following. Calculate state withholding tax at 6.5 percent, and calculate federal withholding tax at 28.0 percent.

1. Write the Java Code needed to perform the following.

Calculate state withholding tax at 6.5 percent, and calculate federal withholding tax at 28.0 percent.

Calculate take-home pay as salary minus total withholding plus deductions.

Calculate total withholding.

Calculate dependent deduction at 2.5 percent of the employee`s salary for each dependent.

2. Save this source code file in a directory of your choice, and then make that directory your working directory.

3. Compile the program.

4. Execute the program. You should get the following output.

State tax: $81.25 Federal Tax: $350.000000000006

Dependents: $62.5 Salary: $1250.0

Take-home pay: $881.25.

In 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 salary and numDependents. Name the modified payroll112.java.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions