Question: PartA You are tasked with creating a program for adding and managing employees in the Th 3 C 0 mp 4 ny company. Requirements and

PartA
You are tasked with creating a program for adding and managing employees in the Th3C0mp4ny
company.
Requirements and Restrictions
Create the following Classes, a driver class called EmployeeManager, Company, Employee
class that inherits from Company, Email class that inherits from Employee
Email will only have the following parameters and are all private.
1. Field to hold @
2. Filed to hold .net
3. Filed to hold .
Email Company is not allowed to have any methods.
Email has one default constructor and only one overloaded constructor that takes:
1. String firstName, String LastName, Employee employee
2. Sets employee.setEmail
Employee will only have the following parameters and are all private.
1. Field to hold firstname
2. Field to hold lastname
3. Field to hold email
4. Field to hold salary
5. Field to hold yearsAtCompany
6. Field to hold employeeId
Employee one default constructor and only one overloaded constructor that takes:
1. String sFirstName, String sLastName
2. Calls new instance of Email to set email
3. Increments id from Company and sets employeeId
Employee may have setters and getters only for above 6 parameters.
Employee may not have any other methods.
Company will only have the following parameters and are all protected.
1. id =90000
2. a prefix field ="R04A"
3. company name field ="Th3C0mp4ny"
Company is not allowed to have any methods.
Company doesnt have any overloaded constructors but has one default constructor.
2
EmployeeManager will only have two parameters in method main
1. ArrayList fileContent = new ArrayList<>();
2. ArrayList employees = new ArrayList<>();
EmployeeManager must have these user-defined Static methods, these methods will do only
what is described and nothing more.
1. Method to obtain file content.
Will check if file exists
It will read the file, the name of the file is Employee.txt obtain from canvas!
It will add each line to the arraylist fileContent.
It will close Scanner input.
2. Method to tokenize and add Employees.
Will break each line into tokens.
In a for loop it will create a new Employee object using overloaded
constructor.
Will Set all remaining fields not set by constructor.
Finally add the employee object in the for loop to the employees ArrayList
3. Method to print the results - results retrieved via loop and getter methods only. You
are not allowed to set any data in this method.
Use this template for the print method:
private static void printCompanyEmployees(ArrayList
employees){
String sStars = String.format("%120s","").replace('','*');
String sDashed = String.format("%120s","").replace('','-');
System.out.printf("%s", sStars);
System.out.printf("%n|%-12s |%-20s |%-20s |%-40s |%-20s",
"EmployeeId ","First Name", "Last Name", "Email Address", "Salary");
System.out.printf("%n%s", sDashed);
for (fill required code){
System.out.printf("%n|%-12s |%-20s |%-20s |%-40s |%-20.2f", fill
required code
}
System.out.printf("%n%s%n", sStars);
}
3
Input:
The only data inputted is what is read from the file
o A Sample Line: Winston#Colins

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!