1
+ import java .util .Date ;
2
+
3
+
1
4
public class Main {
2
5
public static void main (String [] args ) {
3
6
if (args .length > 0 ) {
4
7
if (args [0 ].equals ("ex1" )) {
8
+ Company company = new Company ();
9
+ Employee e1 = new Employee ("Joao" );
10
+ Employee e2 = new Employee ("Manel" );
11
+ company .hireEmployee (e1 );
12
+ company .hireEmployee (e2 );
13
+ company .listActiveEmployees ();
14
+ } else if (args [0 ].equals ("ex2" )) {
5
15
Company company = new Company ();
6
16
Employee e1 = new Employee ("Joao" );
7
17
Employee e2 = new Employee ("Manel" );
@@ -10,16 +20,35 @@ public static void main(String[] args) {
10
20
Chief c1 = new Chief ("Antonio" , Position .CEO );
11
21
company .hireEmployee (c1 );
12
22
company .listActiveEmployees ();
13
- } else if (args [0 ].equals ("ex2" )) {
14
- System .out .println ("ex2" );
23
+ } else if (args [0 ].equals ("ex3" )) {
24
+ Company company = new Company ();
25
+ Employee e1 = new Employee ("Joao" );
26
+ Employee e2 = new Employee ("Manel" );
27
+ company .hireEmployee (e1 );
28
+ company .hireEmployee (e2 );
29
+ Chief c1 = new Chief ("Antonio" , Position .CEO );
30
+ company .hireEmployee (c1 );
31
+
32
+ e1 .addAttendance ();
33
+ e1 .addAttendance ();
34
+ e1 .addAttendance ();
35
+ e2 .addAttendance ();
36
+ e2 .addAttendance ();
37
+ e2 .addAttendance ();
38
+ c1 .addAttendance ();
39
+ e1 .addAttendance ();
40
+
41
+ company .listAttendances ();
15
42
} else {
16
- System .out .println ("default " );
43
+ System .out .println ("Invalid example " );
17
44
}
18
45
} else {
19
- int a = 1 ;
20
- float b = ( float ) 1. 1 ;
21
- boolean c = true ;
46
+ String a = "Hello World" ;
47
+ int b = 1 ;
48
+ float c = ( float ) 1.1 ;
22
49
char d = '\n' ;
50
+ boolean e = true ;
51
+ System .out .println (a );
23
52
}
24
53
}
25
54
}
0 commit comments