Write a Java program that calculates and prints the monthly pay for an employee. The net pay is calculated after taking the following deductions:
Withholding Tax 10%
SSS Contribution 2.50%
Medicare 1.30%
PensionPlan PHP 200.00
Code:
import java.util.Scanner;
class Main
{
public static void main(String arg[])
{
double gross_sal, witholding_tax, sss_contribution, medicare ,pag_ibig_php = 200, netSalary;
Scanner sc=new Scanner(System.in);
System.out.println("Enter Gross salary");
gross_sal=sc.nextDouble();
witholding_tax = 0.1*gross_sal;
sss_contribution = 0.025*gross_sal;
medicare = 0.013*gross_sal;
netSalary = gross_sal- witholding_tax - sss_contribution - medicare - pag_ibig_php;
System.out.println("Net Salary is=" + netSalary);
}
}
Output:
Get Answers For Free
Most questions answered within 1 hours.