-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeeTest.java
More file actions
33 lines (26 loc) · 865 Bytes
/
EmployeeTest.java
File metadata and controls
33 lines (26 loc) · 865 Bytes
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
package sorting.sortparallel;
import java.io.IOException;
import java.util.*;
public class EmployeeTest {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
EmployeeUtil util = new EmployeeUtil();
// Read employee data from the text file
try {
util.readEmployeeData();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Employee[] empArray = util.sortEmpByFirstName();
util.printSortedEmployee();
String firstName;
do {
System.out.println("Enter first name to search: ");
firstName = sc.next();
int foundIndex = util.searchEmployee(0, empArray.length, empArray, firstName);
System.out.println("Search object " + firstName + " found in index " + foundIndex);
} while (!firstName.equalsIgnoreCase("quit"));
System.out.println("Routine terminated");
}
}