/* * Pet.java - Root of class hierarchy for representing residents of a pet kennel * CS112 Lab 13 * Copyright (c) 2000 - Russell C. Bjork */import java.io.*;import java.util.Date;import java.text.DateFormat;/** This class serves as a common base class for classes representing various kinds *	of pets the kennel can house. */public abstract class Pet{	/** Constructor */		public Pet(String name, String owner, Date arrivalDate, Date departureDate)	{	  	this.name = name;	  	this.owner = owner;	  	this.arrivalDate = arrivalDate;	  	this.departureDate = departureDate;	}	/** Accessor for name of this pet */		public String getName()	{	  	return name;	}	  	/** Construct a string describing this pet */		public abstract String getDescription();		/** Accessor for daily rate for boarding this pet */		public abstract int getDailyRate();		/** Print a bill for boarding this pet */		public void printBill(PrintWriter printTo)	{		printTo.println("To my owner, " + owner);		printTo.println("I stayed at the Skunk Hollow Pet Hotel from " +				DateFormat.getDateInstance(DateFormat.MEDIUM).format(arrivalDate) + " to " + 				DateFormat.getDateInstance(DateFormat.MEDIUM).format(departureDate));		printTo.println("I cost you: $" + getDailyRate() *			((departureDate.getTime() - arrivalDate.getTime()) / (1000 * 60 * 60 * 24)));  		printTo.println();		printTo.println("Your loving " + getDescription() + ", " + name);	}		// Instance variables		private String name, owner;	private Date arrivalDate, departureDate;}