首页 > > 详细

辅导CSCI111 Employee调试C/C++程序、C/C++辅导

C++,UMLClass.

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.
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!