Java inheritance

Anonymous
timer Asked: Nov 14th, 2016

Question description

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

Homework Assignment 5 CSCI 111 Due Date Friday 11-18-2016 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) ssn d) phone_number e) per_Hour f) hours g) Constructor h) set/get methods i) compute_Salary that is based on the hours* per_hour j) 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) ssn d) phone_number Homework Assignment 5 CSCI 111 Due Date Friday 11-18-2016 e) salary f) Constructor g) set/get methods h) compute_salary that is based on his salary i) toString method j) 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) ssn d) phone_number e) salary f) bonus g) Constructor h) set/get methods i) compute_salary that is based on his salary and bonus j) 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.
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors