/*
	(c) 1998 Burton Rosenberg. All rights reserved.
*/

class ItemTest
{
	public static void main(String [] args)
	{
		Item [] menu = { new PizzaItem(), new ShoeItem() } ;
		do
		{
			System.out.println("\nSelect an item:") ;
			for (int i=0; i<menu.length; i++ )
			{
				System.out.println((i+1) + " " + menu[i].getDescription()) ;
			}
			System.out.println( "0 Exit.") ;
			int n = corejava.Console.readInt("?") ;
			if ( n==0 ) break ;
			if ( (--n) > menu.length )
			{
				System.out.println("No such item") ;
				continue ;
			}
			System.out.println("\n\nCustomizing " + menu[n].getDescription()) ;
			menu[n].customizeInfo() ;
			System.out.println("\nYour " + menu[n].getDescription()) ;
			menu[n].printInfo() ;
			// add item, make a new one on the menu.
		} while ( true ) ;
	}
}
