/** * Simple test code for Pizza. * @author Dung X. Nguyen *

Copyright 1999 by Dung X. Nguyen - All rights reserved.

* @dependency Pizza uses * @dependency Rectangle uses * @dependency Circle uses * @dependency AShape uses */ public class PizzaClient { /** * Compares the price/area ratios of a round pizza and a rectangular pizza. * Illustrates how to wait for the user's input from the keyboard. */ public static void main (String[] args) { Pizza cirPizza = new Pizza (4.69, new Circle (2.5)); System.out.println (cirPizza); Pizza rectPizza = new Pizza (4.49, new Rectangle (5, 4)); System.out.println (rectPizza); System.out.print ("Round Pizza is a better deal than Rectangular Pizza: "); System.out.println ((cirPizza.dPrice () / cirPizza.dArea () < rectPizza.dPrice () / rectPizza.dArea ())); // Wait for user to press enter: try { System.out.print ("Press enter to quit..."); System.in.read (); } catch (Exception e) { } } }