/** 
 * class Shapes prints out square boxes
 *    today: read in an integer and use Scanner.hasNextFunctions for error checking
 * @author Katie Coons
 * @version February 2, 2007
 */
import java.util.*;

public class Shapes
{
    public static void main(String[] args)
    {
       int width = 0;
       boolean badWidth = true;

       // always allocate a Scanner object for input
       Scanner stdin = new Scanner(System.in);  

       while (badWidth) {
           // No error checking
           System.out.print("Enter the width of a box: ");
           if (!stdin.hasNextInt()) {
               System.out.println("That is not an integer");
               stdin.next();
           } else {
               badWidth = false;
               width = stdin.nextInt();
               System.out.println("Your box width is: " + width + ".\n");  
           }
       }
    }
}