- (Doctor.java, Nurse.java) Add “default”constructors for the Doctor and Nurse (use the HospitalEmployee()default constructor as a guide) (0.5 points)
- (Hospital.java) Declare one new Doctor and Nurseusing the default constructor…then print their paychecks to verifythat your program is working correctly. (0.25points)
This labconsists of the following files:
- Hospital.java (driver)
- HospitalEmployee.java(superclass)
- Doctor.java(subclass ofHospitalEmployee)
- Nurse.java(subclass ofHospitalEmployee)
//Doctor
public class Doctorextends HospitalEmployee
{
protected String specialty;
protected String insurer;
protected double salary;
public Doctor (String name, String SSN, int dep, String special,String ins)
{
super (name, SSN, dep);
specialty = special;
insurer = ins;
salary = 2345.67;
}
/**
* specific to each HospitalEmployee
* @return
*/
protected void issuePayCheck() {
netPay = salary;
System.out.println(“————————————————-“);
System.out.println ( “Staff Physician”);
System.out.println(” Name: ” + getName() + “tID ”
OR
OR