Create a Person class that implements the methods:
Person(name:String, address:string),
get name() : String.
getAddress(): String.
setAddress(address:String):void.
A person should have a last name and an address. It should also be possible to display this information using the toString() method.
Create a Student class that implements the methods:
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
Create a Staff class that implements the methods:
Staff(name:String, address:String, school:String, pay:double)
getSchool():String
setSchool(school:String):void
getPay():double
setPay(pay:double):void
Staff must have a school name (School) and a salary (pay). It should also be possible to display this information using the toString() method.
Comments
Leave a comment