Doctor - }

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Doctor.java Authors: Lewis and Loftus // // Solution to Programming Project 7.2 //******************************************************************** public class Doctor extends HospitalEmployee { protected String specialty; //----------------------------------------------------------------- // Sets up this doctor with the specified information. //----------------------------------------------------------------- public Doctor (String empName, int empNumber, String special) { super (empName, empNumber); specialty = special; } //----------------------------------------------------------------- // Sets this doctor's specialty. //----------------------------------------------------------------- public void setSpecialty (String special) { specialty = special;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } //-----------------------------------------------------------------// Returns this doctor's specialty. //-----------------------------------------------------------------public String getSpecialty() { return specialty; } //-----------------------------------------------------------------// Returns a description of this doctor as a string. //-----------------------------------------------------------------public String toString() { return super.toString() + "\t" + specialty; } //-----------------------------------------------------------------// Prints a message appropriate for this doctor. //-----------------------------------------------------------------public void diagnose() { System.out.println (name + " is a(n) " + specialty + " doctor."); } }...
View Full Document

Ask a homework question - tutors are online