Nurse - // Returns this nurse's current number of patients.

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

View Full Document Right Arrow Icon
//******************************************************************** // Nurse.java Authors: Lewis and Loftus // // Solution to Programming Project 7.2 //******************************************************************** public class Nurse extends HospitalEmployee { protected int numPatients; //----------------------------------------------------------------- // Sets up this nurse with the information specified. //----------------------------------------------------------------- public Nurse (String empName, int empNumber, int numPat) { super (empName, empNumber); numPatients = numPat; } //----------------------------------------------------------------- // Sets the number of patients for this nurse. //----------------------------------------------------------------- public void setNumPatients (int pat) { numPatients = pat; } //-----------------------------------------------------------------
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 nurse's current number of patients. //-----------------------------------------------------------------public int getNumPatients() { return numPatients; } //-----------------------------------------------------------------// Returns a description of this nurse as a string. //-----------------------------------------------------------------public String toString() { return super.toString() + " has " + numPatients + " patients."; } //-----------------------------------------------------------------// Prints a message appropriate for this nurse. //-----------------------------------------------------------------public void assist() { System.out.println (name + " is a nurse with " + numPatients + " patients."); } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online