Hospital - Nurse sonny = new Nurse"Sonny" 789 6...

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

View Full Document Right Arrow Icon
//******************************************************************** // Hospital.java Authors: Lewis and Loftus // // Solution to Programming Project 7.2 //******************************************************************** public class Hospital { //----------------------------------------------------------------- // Creates several objects from classes derived from // HospitalEmployee. //----------------------------------------------------------------- public static void main (String [] args) { HospitalEmployee vito = new HospitalEmployee ("Vito", 123); Doctor michael = new Doctor ("Michael", 234, "Heart"); Surgeon vincent = new Surgeon ("Vincent", 645, "Brain", true);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Nurse sonny = new Nurse ("Sonny", 789, 6); Administrator luca = new Administrator ("Luca", 375, "Business"); Receptionist tom = new Receptionist ("Tom", 951, "Talking", true); Janitor anthony = new Janitor ("Anthony", 123, "Maintenence", false); // print the employees System.out.println (vito); System.out.println (michael); System.out.println (vincent); System.out.println (sonny); System.out.println (luca); System.out.println (tom); System.out.println (anthony); // invoke the specific methods of the objects vito.work(); michael.diagnose(); vincent.operate(); sonny.assist(); luca.administrate(); tom.answer(); anthony.sweep(); } }...
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