Ask Question

Write a Java program that calculates and prints the monthly pay check for an employee. The net pay is calculated after taking the following deductions:

Federal Income Tax: 15%

State Tax: 3.5%

Social Security Tax: 5.75%

Medicare/Medicaid Tax: 2.75%

Pension Plan: 5%

Health Insurance: $75.00

+5
Answers (1)
  1. 21 June, 16:45
    0
    import java. util. Scanner;

    public class salary{

    public static void main (String []args) {

    System. out. println ("Enter the monthly pay: ");

    Scanner scn = new Scanner (System. in);

    double salary = scn. nextDouble ();

    double result = salary - (salary*0.15*0.035*0.0575*0.0275*0.05) - 75;

    System. out. println ("The net salary is: "+result);

    }

    }

    Explanation:

    first import the Scanner class for taking the input from user.

    then, create the main function and print the message for enter the salary from user. scn. nextDouble () store the value enter by user into the result.

    after that, calculate the net salary by calculating the deduction amount and then subtract with salary.

    finally, print the result on the screen.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a Java program that calculates and prints the monthly pay check for an employee. The net pay is calculated after taking the following ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers