Question: Hello, please help me in Java. Please explain if possible with comments. Thank you very much. You are given two .txt files. Employee.txt and Departments.txt.
Hello, please help me in Java. Please explain if possible with comments. Thank you very much.
You are given two .txt files. Employee.txt and Departments.txt.
Create a record named Employee with name, id, department.
Create a class named EmployeeDatabase that reads the Employee.txt with employee data(name, id, department) and the Departments.txt file that has the departments (departments, number of employees in each department).
Create the arrays:
- employee: Employee [][]
-department: String[]
What is allowed: Only Arrays.
What is not allowed: No bufferedReader, no ArrayList.
1. Create a constructor that reads the files with scanners, creates and fill the arrays with the data in the files and sorts the employee list.
2. Add a method named employeeNumber that accepts an integer index and returns the number of employees in that department.
3. Add a method named employeeRetrieval that accepts a String employee id and returns the first department index with that String employee id.
4. Add a method named employeesTotal that returns the number of all employees in all departments
5. Add a method named employeeAtDepartment that accepts an integer department index and an integer employee index and returns the employee at the specified department and employee index.
6. Add a method named departmentNumber that accepts a String department name and returns the number of employees in that department
7. Add a method named departmentTotal that accept an integer index and returns the department name.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
