Inheritance Hierarchy for Graduate Teaching Assistants, Assignments of Computer Science

The design of an inheritance hierarchy for graduate teaching assistants (gradta) based on the given problem statement. Gradta is required to be a student, employee, and countyresident. The document also introduces the discussionta class, a subclass of gradta, which has additional attributes and methods. The hierarchy allows for method overriding and polymorphism, enabling a gradta object to be passed as a parameter to methods with student, employee, or countyresident parameters.

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-mcy-1
koofers-user-mcy-1 🇺🇸

5

(1)

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Inheritance Worksheet (Monday)
For this problem you will design the inheritance hierarchy associated with the following problem:
GradTA is a class that represents graduate teaching assistants. A graduate teaching assistant
(TA) has AT LEAST a name, salary, officeHours and a course to teach. For this problem we want
a graduate TA to have the following IS-A relationships:
1. A GradTA is a Student
2. A GradTA is an Employee
3. A GradTA is a CountyResident
By implementing these relationships a GradTA object can be a parameter to a method that takes
a Student, Employee, or CountyResident. For each relationship we need the following information:
1. Student - Any object considered a Student object will have a name and a career major value. In
addition, the object will support the corresponding get/set methods for those values.
2. Employee - Any object considered a Employee object will have a name and a salary value. In
addition, the object will support the corresponding get/set methods for those values.
3. CountyResident - Any object considered a CountyResident object will have a city and
yearsLivingInCounty value. In addition the object will support the corresponding get/set
methods for those values.
Graduate teaching assistants can be classified into: Discussion teaching assistants and Graders. We
want to have a class called DiscussionTA which is a GradTA and in addition supports the following:
1. Keeps track of the sections the TA teaches.
2. Keeps track of the total number of students he/she helps in class.
3. Keeps track of the cost of helping one student. The salary for a DiscussionTA is based on the
number of students he/she helps.
Based on the above information, define an inheritance hierarchy that allow us to implement the design
specifications provided above. Notice that the inheritance may include interfaces in addition to classes.

Partial preview of the text

Download Inheritance Hierarchy for Graduate Teaching Assistants and more Assignments Computer Science in PDF only on Docsity!

Inheritance Worksheet (Monday)

For this problem you will design the inheritance hierarchy associated with the following problem: GradTA is a class that represents graduate teaching assistants. A graduate teaching assistant (TA) has AT LEAST a name, salary, officeHours and a course to teach. For this problem we want a graduate TA to have the following IS-A relationships:

  1. A GradTA is a Student
  2. A GradTA is an Employee
  3. A GradTA is a CountyResident By implementing these relationships a GradTA object can be a parameter to a method that takes a Student, Employee, or CountyResident. For each relationship we need the following information:
  4. Student - Any object considered a Student object will have a name and a career major value. In addition, the object will support the corresponding get/set methods for those values.
  5. Employee - Any object considered a Employee object will have a name and a salary value. In addition, the object will support the corresponding get/set methods for those values.
  6. CountyResident - Any object considered a CountyResident object will have a city and yearsLivingInCounty value. In addition the object will support the corresponding get/set methods for those values. Graduate teaching assistants can be classified into: Discussion teaching assistants and Graders. We want to have a class called DiscussionTA which is a GradTA and in addition supports the following:
  7. Keeps track of the sections the TA teaches.
  8. Keeps track of the total number of students he/she helps in class.
  9. Keeps track of the cost of helping one student. The salary for a DiscussionTA is based on the number of students he/she helps. Based on the above information, define an inheritance hierarchy that allow us to implement the design specifications provided above. Notice that the inheritance may include interfaces in addition to classes.