For this assignment, you will use inheritance. Your project should include four classes as described below.

1.Create a class that contains the main method. In the main method perform the following:

  • Create a instances of the employee class, the salaried class and the contractor class (described below). Call the payCheck method for each one.
  • Create an array of employee objects. Put all instances of the employee class, salaried class and contractor class into the array.

2.Create a class called employee that includes:

  • A constructor that accepts parameters
  • Instance variables to hold the name and SSN of an employee
  • A payCheck function that displays the employee name and SSN.

3.Create a class called FTE for Full Time Employees that inherits from the employee class and includes:

  • Instance variable to hold the employee's salary
  • A constructor that accepts the name, SSN and salary of an employee. This constructor should call the employee class constructor to set the name and SSN. The constructor should also set the salary instance variable.
  • Override the payCheck function to display the name, SSN and the salary divided by 12. This will be a monthly paycheck.

4.Write a class called contractor that inherits from the employee class that includes:

  • Instance variable to hold the contractor's hourly pay rate.
  • A constructor that accepts the name, SSN, and pay rate. The constructor should call the employee class constructor to set the name and SSN. The constructor should also set the pay rate instance variable.
  • A payCheck method that accepts the hours worked as a parameter. This method should display the contractor's name, SSN and the total pay, which should be calculated by multiplying the pay rate times the hours worked.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.