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

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

-fee:double

+Student(name:String, address:String, program:String, year:int, fee:double)

+getProgram():String

+setProgram(program:String):void

+getYear():int

+setYear(year:int):void

+getFee():double

+setFee(fee:double):void

+toString():String

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!