-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathAttendanceGenerator.java
More file actions
58 lines (56 loc) · 1.96 KB
/
AttendanceGenerator.java
File metadata and controls
58 lines (56 loc) · 1.96 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
public class AttendanceGenerator
{
static void displaymonthwiseAttendance(Employee1 e)
{
System.out.println("Print month-wise attendance of employee:"+e.name+"\n");
for(int i=0;i<2;i++)
{
int count=0;
System.out.println("Attendance for the month:"+e.Attendance[i][0].d.month);
for(int j=0;j<10;j++)
{
if(e.Attendance[i][j].present==1)
{
System.out.println("Date:"+e.Attendance[i][j].d.day+"/"+e.Attendance[i][j].d.month+"/"+e.Attendance[i][j].d.year+" <---PRESENT---> from time "+e.Attendance[i][j].timein+"am to "+e.Attendance[i][j].timeout+"pm");
count++;
}
else
{
System.out.println("Date:"+e.Attendance[i][j].d.day+"/"+e.Attendance[i][j].d.month+"/"+e.Attendance[i][j].d.year+" <---Absent--->");
}
}
System.out.println("\nTotal Number of days "+e.name+ " was Present in month "+ e.Attendance[i][0].d.month+" is "+ count+" out of 10\n");
}
}
static void workingHrs(Employee1 e, Date d)
{
System.out.println("Printing total Woking hours of Employee "+e.name+" with given date");
for(int i=0; i<2; i++)
{
for(int j=0; j<10; j++)
{
if(e.Attendance[i][j].d.day==d.day && e.Attendance[i][j].d.month==d.month && e.Attendance[i][j].d.year==d.year)
{
System.out.println("Day:"+d.day+" Month:"+d.month+" Year:"+d.year);
System.out.println("Total Working hours for the day is "+(e.Attendance[i][j].timeout-e.Attendance[i][j].timein)+"hrs\n");
break;
}
}
}
}
static void workingdaysofemployee(Employee1 e )
{
int count=0;
for(int i=0;i<2;i++)
{
for(int j=0;j<10;j++)
{
if(e.Attendance[i][j].present==1)
{
count++;
}
}
}
System.out.println("Total No of Working Days for an Employee "+e.name +" is "+count+" days out of 20 days"); //2 months
}
}