-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHRAssistant.java
More file actions
75 lines (61 loc) · 2.09 KB
/
HRAssistant.java
File metadata and controls
75 lines (61 loc) · 2.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
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
/**
* <h3>COMP90041, Sem2, 2022: Final Project</h3>
* <p>Class HRAssistant is used to take in command flags from running HRAssistant. Run the approriate type of menu, functionalities and
* display welcome messages.
* @author Gia Han Ly
*/
public class HRAssistant {
public static void main(String[] args){
// Read command line option
Command command = new Command();
command.readCommand(args);
String appFile = command.getApplicationsFile();
String jobsFile = command.getJobsFile();
// Go to HR menu if role flag is set to hr
if(command.getRole().equals("hr")){
displayWelcomeMessage("hr");
HRmenu hrMenu = new HRmenu(jobsFile, appFile);
hrMenu.getInput();
System.out.println();
}
// Go to applicant menu if role flag is set to applicant
else if(command.getRole().equals("applicant")){
displayWelcomeMessage("applicant");
ApplicantMenu menu = new ApplicantMenu(jobsFile, appFile);
menu.getInput();
System.out.println();
}
else if (command.getRole().equals("audit")){
Audit audit = new Audit(jobsFile, appFile);
audit.printStatistics();
}
}
/**
* Display welcome messages depends on role input
* @param role
*/
private static void displayWelcomeMessage(String role) {
Scanner inputStream = null;
String filename = null;
if(role.equals("hr")){
filename = "welcome_hr.ascii";
}
else if(role.equals("applicant")){
filename = "welcome_applicant.ascii";
}
try{
inputStream = new Scanner(new FileInputStream(filename));
}
catch (FileNotFoundException e)
{
System.out.println("Welcome File not found.");
}
while(inputStream.hasNextLine())
{
System.out.println(inputStream.nextLine());
}
}
}