import javabook.*;

/*
 * Introduction to OOP with Java 2nd Edition, McGraw-Hill
 *	
 *   A sample program that illustrates the basic use of nested-for
 *   loop from Section 7.6.
 *   
 *  
 * @author Dr. Caffeine
 *
 */
class CarpetPriceTable
{
    
    public static void main (String[] args)
    {
        
        MainWindow   mainWindow        = new MainWindow();
        OutputBox    outputBox         = new OutputBox(mainWindow);
        
        int price;
        
        mainWindow.setVisible( true );
        
        outputBox.setTitle("Carpet Price Table");
        outputBox.setVisible( true );
        
        outputBox.printLine("        5      10      15      20      25");
        outputBox.skipLine(1);
        
        for (int width = 11; width <= 20; width++) { 
        
            outputBox.print(width + "   ");
          
            for (int length = 5; length <= 25; length += 5) { 
                price = width * length * 19; //$19 per sq ft.
                outputBox.print("   " + price);
            }
          
            //finished one row; now move on to the next row
            outputBox.skipLine(1);
        }
    }
    
}