Question
Create two subclasses: Employee with the following fields: first name, last name, zip, email, employee id, salary, exempt flag, job title, years of service Customer
Create two subclasses:
- Employee with the following fields: first name, last name, zip, email, employee id, salary, exempt flag, job title, years of service
- Customer with the following fields: first name, last name, zip, email, customer id, company, customer type (retail or corporate)
NOTE: Exempt means exempt from laws related to overtime pay (these are usually employees that are salaried as opposed to hourly)
Create a Person class that is the base class of the first two.
- Make sure "users" cannot directly access your fields.
- Provide at least two constructors per class.
- Be sure to initialize all fields within the constructor.
- Provide getters and setters for each field.
- Fully document your code. Javadoc comments are required above the class and each non-trivial method (i.e., any method that contains behavior that could be unexpected).
Be sure to use camel-case field names and methods based on the names above. The Employee class needs a yearsFullyVested "class variable". Provide the appropriate accessor and mutator. All classes belong in the cis315 package.
NOTE: An employee usually must work for some period of time (e.g., 10 years) before being fully vested in the company's retirement plan.
Part II
Override toString and equals in both of the derived classes. The toString method must display all of the information in the object. Two Employee objects are equal if they have the same job title. Two Customer objects are equal if they are corporate customers who work for the same company.
Create a test application (PeopleTester.java) that populates an ArrayList with 10 people. Use all three classes and be sure to test all paths of equals execution (i.e., ensure 100% test coverage).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started