TM - 01 - Employee Information
TM - 01 - Employee Information
TM - 01 - Employee Information
private int emp_id[] = { 1001, 1002, 1003, 1004, 1005, 1006, 1007 };
private String emp_name[] = { "Ashish", "Sushma", "Rahul", "Chahat", "Ranjan", "Suman", "Tanmay" };
"12/06/2006" };
private char desig_code[] = { 'e', 'c', 'k', 'r', 'm', 'e', 'c' };
private String dept[] = { "R&D", "PM", "Acct", "Front Desk", "Engg", "Manufacturing", "PM" };
private int basic[] = { 20000, 30000, 10000, 12000, 50000, 23000, 29000 };
private int hra[] = { 8000, 12000, 8000, 6000, 20000, 9000, 12000 };
private int it[] = { 3000, 9000, 1000, 2000, 20000, 4400, 10000 };
switch(designation)
return 0;
return desig_code[getIndex(id)];
{
int index = -1;
if(id == emp_id[i]) {
index = i;
break;
return index;
return emp_name[getIndex(id)];
return dept[getIndex(id)];
if(getIndex(id) != -1)
return true;
else
return false;
}
public String getDesignation(int id)
char d = getDesigCode(id);
switch(d) {
return null;
if(args.length != 1) {
else {
if(emp.empExists(emp_id)) {
System.out.printf("%6d\n", emp.getSalary(emp_id));
else {
}
}
Output