HospitalEmployee - number = empNumber Returns this...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // HospitalEmployee.java Authors: Lewis and Loftus // // Solution to Programming Project 7.2 //******************************************************************** public class HospitalEmployee { protected String name; protected int number; //----------------------------------------------------------------- // Sets up this hospital employee with the specified information. //----------------------------------------------------------------- public HospitalEmployee (String empName, int empNumber) { name = empName; number = empNumber; } //----------------------------------------------------------------- // Sets the name for this employee. //----------------------------------------------------------------- public void setName (String empName) { name = empName; } //----------------------------------------------------------------- // Sets the employee number for this employee. //----------------------------------------------------------------- public void setNumber (int empNumber)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { number = empNumber; } //-----------------------------------------------------------------// Returns this employee's name. //-----------------------------------------------------------------public String getName() { return name; } //-----------------------------------------------------------------// Returns this employee's number. //-----------------------------------------------------------------public int getNumber() { return number; } //-----------------------------------------------------------------// Returns a description of this employee as a string. //-----------------------------------------------------------------public String toString() { return name + "\t" + number; } //-----------------------------------------------------------------// Prints a message appropriate for this employee. //-----------------------------------------------------------------public void work() { System.out.println (name + " works for the hospital."); } }...
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.

Page1 / 2

HospitalEmployee - number = empNumber Returns this...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online