public double getWages must be either faculty or staff for wages return 00

Public double getwages must be either faculty or

This preview shows page 3 - 5 out of 5 pages.

public double getWages() { // must be either faculty or staff for wages return 0.0; } } // Faculty.java: the class Faculty public class Faculty extends Employee { // inherits from Employee protected double salary; // Constructor public Faculty(double s, String n, String a) { // salary, name, address // Fill in for Part b. } // convert the Faculty class to a String public String toString() { // Fill in for Part c. } public double getWages() { return salary; } } // Staff.java: the class Staff public class Staff // Fill in for Parts d., e., f. } // Persons.java: test the Person-Employee-Faculty-Staff hierarchy public class Persons { public static void main (String[] args) { Person[] persons = new Person[3]; persons[0] = // Fill in for Part g. persons[1] = // Fill in for Part g. persons[2] = // Fill in for Part g. printPersons(persons); System.out.println(); } public static void printPersons(Person[] s) { for (int i = 0; i < s.length; i++)
Image of page 3