C++代写:CSCI111Employee


代写C++基础作业,根据UML图完成相应的Class.

Requirement

Consider the class hierarchy shown in this figure:

  1. Create the super abstract class “Employee” that has the following instance variables, constructor, and methods( you may need to add more methods):
    * a) name
    * b) date_of_birth
    * c) starting_date
    * d) ssn
    * e) phone_number
    * f) Constructor
    * g) set/get methods
    * h) toString method
  2. Create the sub class “Hourly_Based_Employee” that is derived from the super class
    “Employee” and has the following instance variables, constructor, and methods:
    * a) name
    * b) date_of_birth
    * c) starting_date
    * d) ssn
    * e) phone_number
    * f) per_Hour
    * g) hours
    * h) Constructor
    * i) set/get methods
    * j) compute_Salary that is based on the hours* per_hour
    * k) toString method
  3. Create the sub class “Salary_Based_Employee” that is derived from the super class
    “Employee” and has the following instance variables, constructor, and methods:
    * a) name
    * b) date_of_birth
    * c) starting_date
    * d) ssn
    * e) phone_number
    * f) salary
    * g) Constructor
    * h) set/get methods
    * i) compute_salary that is based on his salary
    * j) toString method
    * k)
  4. Create the sub class “Manager_Employee” that is derived from the class
    “Salary_Based_Employee” and has the following instance variables, constructor,
    and methods:
    * a) name
    * b) date_of_birth
    * c) starting_date
    * d) ssn
    * e) phone_number
    * f) salary
    * g) bonus
    * h) Constructor
    * i) set/get methods
    * j) compute_salary that is based on his salary and bonus
    * k) toString method
  5. Create the “Testing” class that has the main method and does the following:
    * a) Are you able to create an object of Employee class?
    * b) Use the constructor to create object of Hourly_Based_Employee class.
    * c) Use the constructor to create object of Salary_Based_Employee class.
    * d) Use the constructor to create object of Manager_Employee class.
    * e) Define three elements array of “Employee”.
    * f) Let each element in the array refer to objects created in b, c, and d
    * g) Call compute_salary and toString using objects created in b, c, and d
    * h) Call compute_salary and toString using array elements defined in f. You need to design the abstract class in a way that allow you to call this method.
    * i) What is the difference between results obtained from g and h.

文章作者: SafePoker
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 SafePoker !
  目录