-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployer.java
More file actions
67 lines (64 loc) · 1.75 KB
/
Employer.java
File metadata and controls
67 lines (64 loc) · 1.75 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import java.util.*;
public class Employer extends Info{
Scanner sc=new Scanner(System.in);
void emp_disp_all()
{
for (Map.Entry m: employeeMap.entrySet())
{
System.out.println("Employee: "+m.getKey());
}
}
void addAttendance(){
int stat; int i=0;
System.out.print("Give attendance to all employees\n1 for Present\n0 for absent");
while(i<l)
{
System.out.print("Employee: "+ename[i]+" Status: ") ;
stat=sc.nextInt();
try{
if(stat!=1 || stat!=0){
throw new exception("Please enter either 1 or 0");
}
}
catch(exception e){
System.out.println(e.getMessage());
}
if (stat==1){
p[i]++;
i++;
}
else{
a[i]++;
i++;
}
}
}
void leaveRec(){
int approve;
int i=0;
while(i<s)
{
System.out.println("===============Leave Request===============");//From Reason of *n* Person
System.out.println("USERNAME- "+ leave[i][0]);
System.out.println("REASON- "+ leave[i][1]);
System.out.println("Enter 0 for Rejection and 1 for Approval");
approve=sc.nextInt();
try{
if(approve!=1 || approve!=0){
throw new exception("Please enter either 1 or 0");
}
}
catch(exception e){
System.out.println(e.getMessage());
}
if (approve==1){
leave[i][2]="ACCEPTED";
i++;
}
else{
leave[i][2]="DECLINED";
i++;
}
}
}
}