Java Program Make two new data type classes. One class will be named employee and the other will…
Java Program
- Make two new data type classes. One class will be named employee and the other will be named salary.
- The employee class stores the details of the employee id, employee name, years of experience, phone number and location. The salary class stores the details of the employee salary and job position.
- Now make a new class called mainDriver that displays the main menu as shown below.
Display Menu
- Enter a new employee
- Remove an existing employee
- Search for a employee by their employee id
- Change the years of experience
- Print all the employees
- Exit
- The employee details will be given in a csv format such as the following for class employee.
89452, Miller, Liam, 4, 956233165, Arizona
23152, Steven, Holmes, 9, 562333165, Arkansas
23312, William, Shauna, 2, 23333165, New Jersey
- The employee salary details will be given in csv format such as the following for class salary.
32233, clerk
59942, manager
45656, assistant
- Now declare an arraylist named salary to store the details on the salary.csv. Then open to read the two csv files parallelly. Combine the information of the employee id, employee name, years of experience, phone number and the location with the salary.
- Now make a new object of class employee and make a hashmap named employeeList to add the information in the object class.
- The output should look like the following –
Employee id: 89452
Employee name: Liam Miller
Years of experience: 4
Phone number: 956233165
Location: Arizona
Salary: 32233
Job Position: Clerk
- Make sure to use inheritance for the class objects salary and employee to be able to combine information.
- Do all the required tasks and for the exit task, before the program gets closed, open the file employee.csv and salary.csv to write.
- Each node of the information should be written in one line as splitted in commas just like the default. Such as this following example (each should be written on the next line) and save it to a text file.
89452, Miller, Liam, 4, 956233165, Arizona
23152, Steven, Holmes, 9, 562333165, Arkansas
23312, William, Shauna, 2, 23333165, New Jersey