Question: Task 2 Person -name:String -address:String = String +getName():String +getAddress():String +setAddress(address:String):void +setName(name:String):void Staff -school:String -pay:double +Staff(name:String, address:String, pay:double) +getSchool():String +setSchool(school:String):void +getPay():double +setPay(pay:double):void +toString():String Student -program:String -year:int
Task 2
|
|
For task 2, implement the three classes (Person, Student, and Staff) that are described above. Note that classes Staff and Student are derived from the superclass Person -- in other words Staff and Student inherit from Person. Make sure that the subclasses Student and Staff invoke the superclass' constructors and correctly inherit the variables and methods from the superclass Person. Also note that Person is an abstract class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
