forked from isenmit/javalab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
41 lines (38 loc) · 1.92 KB
/
Employee.java
File metadata and controls
41 lines (38 loc) · 1.92 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
38
39
40
41
import java.util.Date;
import java.util.Stack;
public class Employee
{
public static void main(final String[] args) {
System.out.println("Enter Valid Employee ID : \n");
final int[] EmpId = { 1001, 1002, 1003, 1004, 1005, 1006, 1007 };
final String[] EmpName = { "Abc", "Opqr", "Ghi", "Wxyz", "Jklmn", "Stuv", "Def" };
final String[] JoinDate = { "01/04/2009", "23/08/2012", "12/11/2008", "29/01/2013", "16/07/2005", "01/01/2000",
"12/06/2006" };
final char[] DesigCode = { 'e', 'c', 'k', 'r', 'm', 'e', 'c' };
final String[] Department = { "R&D", "PM", "Acct", "Front Desk", "Engg", "Manufacturing", "PM" };
final double[] Basic = { 20000, 30000, 10000, 12000, 50000, 23000, 29000 };
final double[] HRA = { 8000, 12000, 8000, 6000, 20000, 9000, 12000 };
final double[] IT = { 3000, 9000, 1000, 2000, 20000, 4400, 10000 };
final char[] DesignationCode = { 'e', 'c', 'k', 'r', 'm' };
final String[] Designation = { "Engineer", "Consultant", "Clerk", "Receptionist", "Manager" };
final double[] DA = { 20000, 32000, 12000, 15000, 40000 };
int flag = 0;
final int id = Integer.parseInt(args[0]);
for (int i = 0; i < EmpId.length; i++) {
if (EmpId[i] == id) {
flag = 1;
System.out.println("Emp Id. Emp Name Department Designation DA");
System.out.print(EmpId[i] + " " + EmpName[i] + " " + Department[i]);
for (int j = 0; j < DesignationCode.length; j++) {
if (DesigCode[i] == DesignationCode[j]) {
System.out.print(" " + Designation[j] + " ");
final double sum = Basic[i] + HRA[i] + DA[j] - IT[i];
System.out.print(sum);
}
}
}
}
if(flag==0)
System.out.println("There is no employee with EmpId : " +id);
}
}