Question: 1 . A class, Person, with an instance variable, name. Write appropriate accessor and mutator methods for the class. Also write a toString method for

1.A class, Person, with an instance variable, name. Write appropriate accessor and mutator methods for the class. Also write a toString method for the class.
2.Employee, that extends Person, and has: two additional instance variables, ID and payRate; and an additional method, pay, that returns the payRate. Override the toString method accordingly.
3.Faculty, that extends Employee, and has two additional variables; officeHours of type String and teachingCourses, which is an array of Courses. Each course has course code and course title. Write appropriate accessor, mutator and toString methods for the class.
4.TestPersons, that has two methods: void printPerson(Person p) that prints its argument. And a main method that creates an instance of each of the above classes and prints it using printPerson method.

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 Programming Questions!