-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeeApplication.java
More file actions
124 lines (85 loc) · 5.09 KB
/
EmployeeApplication.java
File metadata and controls
124 lines (85 loc) · 5.09 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package com.employee;
import java.io.IOException;
public class EmployeeApplication {
public static void main(String[] args) throws IOException {
// ************************************ DO NOT CHANGE ************************************
int[] registeredEmployeesSample1 = { 123, 121, 140, 197, 180, 187, 183, 165, 167, 186, 105, 189, 101, 175, 188,
190, 106 };
int[] registeredEmployeesSample2 = {111,132,174,122,156,157,123,117};
// Fetching Employees from CSV file using a method fetchEmployee of
FetchRecordsFromCSV fetchCSV = new FetchRecordsFromCSV();
String[] browsingHistory = fetchCSV.getBrowsingHistory();
String[] restrictedWebsites = fetchCSV.getRestrictedWesites();
String permanentEmployeeFileName = "src/data/PermanentEmployeeRecords.csv";
String contractEmployeeFileName = "src/data/ContractEmployeeRecords.csv";
PermanentEmployee[] permanent = null;
ContractEmployee[] contract = null;
PermanentEmployee newEmployee = null;
PermanentEmployee[] permanentLL = null;
// ************************************ DO NOT CHANGE ************************************
// ************************************ TODO 1.5 ***********************************
/* Call method getPermanentEmployee of FetchRecordsFromCSV and
pass permanentEmployeeFileName as a parameter
receive the data returned by method getPermanentEmployee into "permanent" object declared above
*/
permanent = fetchCSV.getPermanentEmployee(permanentEmployeeFileName);
// ************************************ TO DO 1.6 ************************************
/* Call method getContractEmployee of FetchRecordsFromCSV and
pass contractEmployeeFileName as a parameter
receive the data returned by method getContractEmployee into "contract" object declared above
*/
contract = fetchCSV.getContractEmployee(contractEmployeeFileName);
// ************************************ TO DO 1.7 ************************************
/* Call method getPermanentEmployee of FetchRecordsFromCSV and
pass permanentEmployeeFileName as a parameter
receive the data returned by method getPermanentEmployee into "permanentLL" object declared above
*/
permanentLL = fetchCSV.getPermanentEmployee(permanentEmployeeFileName);
System.out.println("===================PART A ==========================");
PartA partA = new PartA();
// implement the method createTeams(permanent) in PartA.java
partA.createTeams(permanent);
// implement the method findTwoBestPerformers(permanent) in PartA.java
partA.findTwoBestPerformers(permanent);
System.out.println("===================PART B ==========================");
// implement the method searchForAnEmployee(permanent, 195) in PartB.java
new PartB().searchForAnEmployee(permanent, 195);
System.out.println("===================PART C ==========================");
// implement the method getHighestToMedianSalary(permanent) in PartC.java
PartC partC = new PartC();
PermanentEmployee[] permanentSalaries = partC.getHighestToMedianSalary(permanent);
System.out.println("===================PART D ==========================");
// Implement the method getHighestContractSalaries(contract) in PartD.java
PartD partD = new PartD();
ContractEmployee[] contractSalaries = partD.getHighestContractSalaries(contract);
// Implement unionOfSalaries(permanentSalaries, contractSalaries) in PartD.java.
partD.unionOfSalaries(permanentSalaries, contractSalaries);
System.out.println("===================PART E ==========================");
PartE partE = new PartE();
// Implement the method getFrequencyOfVisitedWebsites(browsingHistory, restrictedWebsites) in PartE.java
partE.getFrequencyOfVisitedWebsites(browsingHistory, restrictedWebsites);
// Implement the method findSimilarNamedTeams(permanent) in PartE.java
partE.findSimilarNamedTeams(permanent);
System.out.println("===================PART F ==========================");
PartF partF = new PartF();
//Implement the method newEmployeeStructure(permanentLL) in PartF.java
SingleLinkedList list = partF.newEmployeeStructure(permanentLL);
//ReInitialize newEmployee Object declared above with the details given in the Problem Statement
//Implement the method addNewEmployee(list, newEmployee) in PartF.java
newEmployee = new PermanentEmployee(135,"Kshitij",39,"2123456789",70000,60,"Mumbai");
list = partF.addNewEmployee(list, newEmployee);
// Implement the method removeAbscondedEmployee(list) in PartF.java
list = partF.removeAbscondedEmployee(list);
System.out.println("===================PART G ==========================");
// implement lineUpFoodCoupons(registeredEmployees) in PartG.java
// implement distributeFoodCoupons(registeredEmployees) in PartG.java
PartG partG = new PartG();
int couponCount1 = 10;
int couponCount2 = 5;
Queue que = partG.lineUpFoodCoupons(registeredEmployeesSample1);
que = partG.distributeFoodCoupons(couponCount1);
que = partG.lineUpFoodCoupons(registeredEmployeesSample2);
que = partG.distributeFoodCoupons(couponCount2);
System.out.println("===================THE END==========================");
}
}