

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CSIS 212
Exercise 9.5 JHTP: Draw an inheritance hierarchy for students at a university similar to the hierarchy shown in Fig 9.2. Use Student as the superclass of the hierarchy, then, extend Student with classes Undergraduate Student and Graduate Student. Continue to extend the hierarchy as deep (i.e., as many levels as possible). For example, Freshmen, Sophomore, Junior, and the Senior might extend Undergraduate Student and Doctoral Student and Masters Student might be subclasses of Graduate Students. After drawing the hierarchy, discuss the relationships that exist between the classes. [Note: You do not need to write any code for this exercise]. The graph describes the many classes in an inheritance hierarchy as an is-a relationship, i.e: every member of a class at the bottom of every arrow is a member of the class at the upper part of the arrow. For example, every freshman is an undergraduate student and every undergraduate student is considered a student. However, this is-a relationship is not necessary, as it is possible to add a subclass like FavoriteIceCream as to the superclass Student. Exercise 10.6: How does polymorphism promote extensibility? The benefit of applying polymorphic behavior to software is that they can be ultilized in a way that of which is independent of the object types (assume that these object types belongs to the same inheritance hierarchy). Thus, it is possible for software developer to incorporate new method calls to the software without major modification of the base system
CSIS 212 Exercise 10.12: Payroll Modification Modify the payroll system of Figs 10.4 –10.9 to include private instance variable birthdate in class Employee. Use class Date of Fig 8.7 to represent an employee’s birthday. Add get methods to class Date. Assume that payroll is processed once per month. Create an array of Employee variables to store references to the various employee objects. In a loop, calculate the payroll for each Employee (polymorphic ally), and add a $100.00 bonus to the persons payroll amount if the current month is the one in which the Employee’s birthdate occurs. Integrity Assertion o I have not shared the source code in my program with anyone other than my instructor’s approved human sources. o I have not used source code obtained from another student, or any other unauthorized source, either modified or unmodified. o If any source code or documentation used in my program was obtained from another source, such as a text book or course notes, that has been clearly noted with a proper citation in the comments of my program. o I have not knowingly designed this program in such a way as to defeat or interfere with the normal operation of any machine it is graded on or to produce apparently correct results when in fact it does not.