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 ThCmpny
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.
Field to hold @
Filed to hold net
Filed to hold
Email Company is not allowed to have any methods.
Email has one default constructor and only one overloaded constructor that takes:
String firstName, String LastName, Employee employee
Sets employee.setEmail
Employee will only have the following parameters and are all private.
Field to hold firstname
Field to hold lastname
Field to hold email
Field to hold salary
Field to hold yearsAtCompany
Field to hold employeeId
Employee one default constructor and only one overloaded constructor that takes:
String sFirstName, String sLastName
Calls new instance of Email to set email
Increments id from Company and sets employeeId
Employee may have setters and getters only for above parameters.
Employee may not have any other methods.
Company will only have the following parameters and are all protected.
id
a prefix field RA
company name field ThCmpny
Company is not allowed to have any methods.
Company doesnt have any overloaded constructors but has one default constructor.
EmployeeManager will only have two parameters in method main
ArrayList fileContent new ArrayList;
ArrayList employees new ArrayList;
EmployeeManager must have these userdefined Static methods, these methods will do only
what is described and nothing more.
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.
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
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 printCompanyEmployeesArrayList
employees
String sStars String.formatsreplace;
String sDashed String.formatsreplace;
System.out.printfs sStars;
System.out.printfns s s s s
"EmployeeId "First Name", "Last Name", "Email Address", "Salary";
System.out.printfns sDashed;
for fill required code
System.out.printfns s s s f fill
required code
System.out.printfnsn sStars;
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
