Doctorjava Nursejava Add Default Constructors Doctor Nurse Use Hospitalemployee Default Co Q37234782

  1. (Doctor.java, Nurse.java) Add “default”constructors for the Doctor and Nurse (use the HospitalEmployee()default constructor as a guide) (0.5 points)
  1. (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:

  1. Hospital.java (driver)
  2. HospitalEmployee.java(superclass)
  3. Doctor.java(subclass ofHospitalEmployee)
  4. 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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.