Ask Question
21 November, 21:05

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. 22 November, 00:42
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers