Initialize two (2) variables to hold the employee name and the gross pay (amount before deductions). See sample output below.
Employee Name: Jess Diaz
Gross Pay: 25000.0
_________________________
Deductions Amount
Witholding Tax 3750.0
SSS Contributions: 907.5
Medicare: 312.5
Pagibig Contribution: 100.0
__________________________
Net Pay: 19930.0
public class Main {
static class Employee {
String name;
double grossPay;
}
public static void main() {
Employee emp = new Employee();
emp.name = "Jess Diaz";
emo.name = 25000.0;
System.out.println("_________________________");
System.out.println("Deductions Amount");
System.out.println("Witholding Tax 3750.0");
System.out.println("SSS Contributions: 907.5");
System.out.println("Medicare: 312.5");
System.out.println("Pagibig Contribution: 100.0");
System.out.println("_________________________");
System.out.println("Net Pay: 19930.0");
}
}
Comments
Leave a comment