Janitor - // Returns the current sweeping status of this...

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

View Full Document Right Arrow Icon
//******************************************************************** // Janitor.java Authors: Lewis and Loftus // // Solution to Programming Project 7.2 //******************************************************************** / public class Janitor extends Administrator { protected boolean sweeping; //----------------------------------------------------------------- // Sets up this janitor with the specified information. //----------------------------------------------------------------- public Janitor (String empName, int empNumber, String dept, boolean sw) { super (empName, empNumber, dept); sweeping = sw; } //----------------------------------------------------------------- // Sets the sweeping status of this janitor. //----------------------------------------------------------------- public void setIsSweeping (boolean isS) { sweeping = isS; } //-----------------------------------------------------------------
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 the current sweeping status of this janitor. //-----------------------------------------------------------------public boolean getIsSweeping () { return sweeping; } //-----------------------------------------------------------------// Returns a description of this janitor as a string. //-----------------------------------------------------------------public String toString () { return super.toString() + "\tSweeping: " + sweeping; } //-----------------------------------------------------------------// Prints a message appropriate for this janitor. //-----------------------------------------------------------------public void sweep() { System.out.print (name + " is"); if (!sweeping) System.out.print (" not"); System.out.println (" sweeping the floor."); } }...
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