//******************************************************************** // Dictionary2.java Author: Lewis and Loftus // // Represents a dictionary, which is a book. //******************************************************************** class Dictionary2 extends Book2 { private int definitions; //----------------------------------------------------------------- // Sets up the dictionary with the specified number of pages // (maintained by the Book parent class) and defintions. //----------------------------------------------------------------- public Dictionary2 (int pages, int definitions) { super (pages); this.definitions = definitions; } //----------------------------------------------------------------- // Prints a message using both local and inherited values. //----------------------------------------------------------------- public void definitionMessage () { System.out.println ("Number of definitions: " + definitions); System.out.println ("Definitions per page: " + definitions/pages); } }