C# Create a base Employee class with instance variables and properties

profileTopsolutions
 (Not rated)
 (Not rated)
Chat

Create a base Employee class with instance variables and properties: FirstName & LastName. The constructor for Employee should accept values for firstname, lastname and socialSecurityNumber and initial the values. Employee should have a toString method to output the values for each employee.

Create a derived class for an employee type Pieceworker. A pieceworker is paid a fee for each piece completed, i.e., # pieces * fee per piece. Class Pieceworker should add private instance variables fee and pieces. Pieceworker should inherit from Employee; adding in an earnings method to calculate earnings. Create a constructor to initialize firstname, lastname, socialSecurityNumber, fee and pieces. Override the toString method to output all variables.

Create a third class to create objects of Pieceworker, then calculate earnings; output all values including earnings.

 

 

    • 12 years ago
    Complete A++ Solution
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      pieceworker_solution.zip