
public class pgm06_03_03ParametizedConstructor {

		public static void main(String[] args) {
			Rectangle1 rect1 = new Rectangle1();
			Rectangle2 rect2 = new Rectangle2();
			Rectangle3 rect3 = new Rectangle3(3.0, 4.0);
			//Rectangle3 rect3a = new Rectangle3();			//No-Arg constructor is undefined

			System.out.println("Rectangle 1");
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect1.getLength(), rect1.getWidth(), rect1.area(), rect1.hypoteneuse()
					);
			
			rect1.setLength(3.0);
			rect1.setWidth(4.0);
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect1.getLength(), rect1.getWidth(), rect1.area(), rect1.hypoteneuse()
					);

			rect1.setLength(5.67);
			rect1.setWidth(6.78);
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect1.getLength(), rect1.getWidth(), rect1.area(), rect1.hypoteneuse()
					);
			
			System.out.println();
			System.out.println("Rectangle 2");
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect2.getLength(), rect2.getWidth(), rect2.area(), rect2.hypoteneuse()
					);
			
			rect2.setLength(3.0);
			rect2.setWidth(4.0);
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect2.getLength(), rect2.getWidth(), rect2.area(), rect2.hypoteneuse()
					);

			rect2.setLength(5.67);
			rect2.setWidth(6.78);
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect2.getLength(), rect2.getWidth(), rect2.area(), rect2.hypoteneuse()
					);

			System.out.println();
			System.out.println("Rectangle 3");
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect3.getLength(), rect3.getWidth(), rect3.area(), rect3.hypoteneuse()
					);
			
			rect3.setLength(5.0);
			rect3.setWidth(12.0);
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect3.getLength(), rect3.getWidth(), rect3.area(), rect3.hypoteneuse()
					);

			rect3.setLength(5.67);
			rect3.setWidth(6.78);
			System.out.printf("length = %.2f width = %.2f area = %.3f hypoteneuse = %.3f\n",
					rect3.getLength(), rect3.getWidth(), rect3.area(), rect3.hypoteneuse()
					);

	}

}
