

public class ConsoleInDemo
{
   public static void main(String[] args)
   {
     char ans;

     do
     {
          System.out.println("Enter width of lot in feet:");
          double width = ConsoleIn.readLineDouble( );

          System.out.println("Enter length of lot in feet:");
          double length = ConsoleIn.readLineDouble( );

          double area = width*length;

          System.out.println("A lot that is " + width
                                              + " feet wide");
          System.out.println("and " + length + " feet long");
          System.out.println("has an area of " + area
                                        + " square feet.");

          System.out.println("Repeat calculation? (y/n)");
          ans = ConsoleIn.readLineNonwhiteChar( );
     } while (Character.toLowerCase(ans) == 'y');

     System.out.println("End of program.");
   }
}
