Create a directory PersonSuperclass
that has four files in it:
Person
class includes instance variables that identify a person by name
and age
(an int
value). Include accessor methods for those two attributes, as well as a celebrateBirthday
method that increases the person's age by one.Student
subclass inherits from Person
, and includes a String
instance variable major
that identifies that student's major in school. Include a getMajor
getter method as well as a changeMajor
setter method.Instructor
subclass that also inherits from Person
, and includes a double
variable salary
that tracks the instructor's yearly pay, and a getSalary()
method.PersonSuperclassTester
program creates and tests instances of each of these classes.