/* * Tester for CS112 Lab 13 - load up the kennel with pets and * bill their owners! * */import java.io.*;import java.util.Date;import java.text.DateFormat;import java.text.ParseException;public class Lab13{    public static void main(String [] args) throws IOException    {		// Create two output boxes to display results in				PrintWriter bills = new PrintWriter(new FileWriter("bills.out"));				// Load up the kennel with pets			    Pet [] kennel =	    { 	    	new Rodent("Mickey", "W. Disney", toDate("1-Jan-2002"), toDate("4-Jan-2002"), "mouse"),	    	new Bird("Tweety", "Granny", toDate("1-Sep-2001"), toDate("5-Sep-2001"), "canary"),	    	new Reptile("Ignatius", "Swamp Rat", toDate("7-Oct-2001"), toDate("10-Oct-2001"), "iguana"),	    	new Cat("Garfield", "J. Arbuckle", toDate("1-Jan-2002"), toDate("31-Jan-2002"), 20, true),	    	new Dog("Snoopy", "C. Brown", toDate("1-Jan-2002"), toDate("2-Jan-2002"), 15, false, "beagle"),	    	new Cat("Sylvester", "Granny", toDate("1-Sep-2001"), toDate("5-Sep-2001"), 15, false),	    	new Dog("Butch", "Granny", toDate("1-Sep-2001"), toDate("5-Sep-2001"), 45, true, "bulldog")	    };	    // Print bills for all the pets		    String dashes = "----------------------------------------"; dashes += dashes;			bills.println(); bills.println(dashes); bills.println();			    for (int i = 0; i < kennel.length; i++)	    {			bills.println("Bill for " + kennel[i].getName() + ":"); bills.println();			kennel[i].printBill(bills);			bills.println(); bills.println(dashes);		}		  		bills.close();		System.exit(0);	}		// Convert a character string representation of a date to a date object	  	private static Date toDate(String string)	{		try		{ return DateFormat.getDateInstance(DateFormat.MEDIUM).parse(string); }		catch(ParseException e)		{ return null; }	}}