PROGRAM RectangleTester
!----------------------------------------------------------------------
! Driver program to test the data type Rectangle defined in module
! Rectangle_Type.  Variables used are:
!   A, B, C : three rectangles
!   RealVal : a real value
! Input  : Sides of rectangles, a real value
! Output : Sides of rectangles
!----------------------------------------------------------------------

  USE Rectangle_Type

  TYPE(Rectangle) :: A, B, C
  REAL :: RealVal

  PRINT *, "Enter the lengths of the sides of a rectangle:"
  READ *, A%Side1, A%Side2
  PRINT *, "Enter the lengths of the sides of another rectangle:"
  READ *, B%Side1, B%Side2

  PRINT *, "Testing the +, *, and == operations:"
  C = A + B
  PRINT *, "Sum of the rectangles: ",  C%Side1, C%Side2

  C = 2.0*A
  PRINT *, "2*(first rectangle): ",  C%Side1, C%Side2

  PRINT *, "Rectangles equal (T or F)? ", A == B

  PRINT *
  PRINT *, "Testing the .int. operation:"
  C = A .int. B
  PRINT *, "Intersection: ",  C%Side1, C%Side2

  PRINT *
  PRINT *, "Testing the extended assignment operation:"
  PRINT *, "Enter the length of a side of a square"
  READ *, RealVal
  C = RealVal
  PRINT *, "Square: ",  C%Side1, C%Side2

END PROGRAM RectangleTester
