home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LANGUAGE / ADA / LOVELACE / figures.ads < prev    next >
Text File  |  1996-10-01  |  785b  |  37 lines

  1. package Figures is
  2.  -- Package to demonstrate Object Orientation.
  3.  
  4. type Point is
  5.    record
  6.       X, Y: Float;
  7.    end record;
  8.  
  9. type Figure is tagged
  10.    record
  11.       Start : Point;
  12.    end record;
  13. function Area  (F: Figure) return Float;
  14. function Perimeter (F:Figure) return Float;
  15. procedure Draw (F: Figure);
  16.  
  17. type Circle is new Figure with
  18.    record
  19.       Radius: Float;
  20.    end record;
  21. function  Area (C: Circle) return Float;
  22. function  Perimeter (C: Circle) return Float;
  23. procedure Draw (C: Circle);
  24.  
  25. type Rectangle is new Figure with
  26.    record
  27.       Width: Float;
  28.       Height: Float;
  29.    end record;
  30. function Area (R: Rectangle) return Float;
  31. function Perimeter (R: Rectangle) return Float;
  32. procedure Draw (R: Rectangle);
  33.  
  34. type Square is new Rectangle with null record;
  35.  
  36. end Figures;
  37.