-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeeTest.java
More file actions
37 lines (28 loc) · 1.3 KB
/
EmployeeTest.java
File metadata and controls
37 lines (28 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.*;
public class EmployeeTest {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
// Taking Input
System.out.println("Enter the id");
int id = scanner.nextInt();
System.out.println("Enter the name");
String name = scanner.next();
System.out.println("Enter the monthlyBasic");
int monthlyBasic = scanner.nextInt();
Employee employee = new Employee();
int annualBasic = employee.getAnnualBasic(monthlyBasic);
System.out.println("Annual Basic is " + annualBasic);
// Calling function for Calculating
int hra = employee.getHra();
int medicalAllowance = employee.getMedicalallowance();
int conveyanceAllowance = employee.getConveyanceallowance();
int monthlyGrossSalary = employee.getMonthlyGrossSalary();
System.out.println("Monthly Gross Salary is " + monthlyGrossSalary);
int annualGrossSalary = employee.getAnnualGrossSalary(monthlyGrossSalary);
System.out.println("Annual Gross Salary is " + annualGrossSalary);
int monthlyDeductions = employee.getMonthlyDeductions();
System.out.println("Monthly Deduction is " + monthlyDeductions);
int monthlytakeHome = employee.getMonthlyTakeHome(monthlyGrossSalary, monthlyDeductions);
System.out.println("Monthly Take Home is " + monthlytakeHome);
}
}