TCO 4) Consider the class Employee
TCO 4) Consider the class Employee. Given your knowledge of some common components of employees,
–
show a class hierarchy in which the class Employee inherits from other classes which, in turn, can also be inherited from yet other classes;
– discuss inheritance from class Employee for other closely related derived classes; and
– discuss the common components of class Employee. (Points : 18)
Question 4. 4. (TCO 3) How does the “is-a” relationship relate to inheritance? Give an example of such a relationship. (Points : 18) |
Question 5. 5. (TCO 2) Cylinder is a class that is derived from the Circle class. The Circle class has one attribute that represents radius. The Cylinder class has one additional attribute that represents the height. Each of the two classes have a member function named printResult(). Write the class descriptions for each of the two classes with the appropriate constructors, area method, volume method, accessor methods, and mutator methods using appropriate naming conventions and data types. Do not write the function implementation. (Points : 18) |
Question 6. 6. (TCO 2) Define and implement the overloaded constructors that support the following test function for a Time class. The data members for the Time class are hour, minute, and second. All are integer data types. public static void main(String args[]) { //t1 will take default value Time t1 = Time(); //t2 will take supplied values Time t2 = Time(8, 26, 58); //t3 will take supplied hour. minute & second will take default values Time t3 = Time(9); //t4 will take supplied hour and minute. second will take default value Time t4 = Time(11, 50); //t5 will take the same value as t2 Time t5 = t2; //the rest of the code } (Points : 18) |
Question 7. 7. (TCO 8) Your company has just hired you to increase programmer productivity. You review existing program code and notice that no specific naming convention has been followed. What would you say to explain the best practices regarding |
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
