// Name:     Bradley Shedd
// Program:  Quiz#1
// Date:     October 6, 2010
// Class:    Java1302
// Filename: RectangleTest.java
 
   
public class RectangleTest
   {
      
public static void main( String[] args)
      {
         Rectangle rec1 =
new Rectangle();
        
float rectangleLength = rec1.getLength();
        
float rectangleWidth = rec1.getWidth();
        
float rectanglePerimeter = rec1.calculatePerimeter();
        
float rectangleArea = rec1.calculateArea();
         System.out.println(
"The length of rectangle1 is\t" + rectangleLength +
           
"\nThe width of rectangle1 is\t" + rectangleWidth +
           
"\nPerimeter of rectangle1 is \t" + rectanglePerimeter +
           
"\nArea if rectangle1 is \t" + rectangleArea);
     
         System.out.println( rec1 );
     
         Rectangle rec2 =
new Rectangle( 1.0f, 1.0f );
        
float rectangle2Length = rec2.getLength();
        
float rectangle2Width = rec2.getWidth();
        
float rectangle2Perimeter = rec2.calculatePerimeter();
        
float rectangle2Area = rec2.calculateArea();
         System.out.println(
"The length of rectangle 2 is\t" + rectangle2Length +
                   
"\nThe width of rectangle 2 is\t" + rectangle2Width +
                   
"\nPerimeter of rectangle 2 is\t" + rectangle2Perimeter +
                   
"\nArea of rectangle 2 is\t" + rectangle2Area +
                   
"\nRectangle 1 and rectangle 2 equal: " + rec1.equals(rec2));
                   
              
         System.out.println( rec2 );
     
         rec1.setLength(18.0f);
         rec1.setWidth(13.0f);
         System.out.println(
"New rectangle" + rec1 +
                  
"\nRectangle 1 and rectangle 2 equal: " + rec1.equals(rec2));
        
         System.out.println(
"Coded by: Bradley J. Shedd"); 
      }
   }





Homepage