#include <fstream.h>
#include <string.h>
#include <math.h>

//Header file for class Figure

const Size = 9;

enum FigKind {Circle, Rectangle, Square, Triangle};

struct RectangleType
{
  float Width, Length;
};

struct TriangleType
{
  float Base, Height;
};

class Figure
{
  struct FigureType
  {
    char Name[Size];
    float Area;
    float Perimeter;
    FigKind Shape;
    union
    {
      float Radius;         //circle
      RectangleType Rec;    //rectangle
      float Side;           //square
      TriangleType Tri;     //triangle
    };
  };

  struct FigureType OneFig;

public:
  void Create();
  void Init(FigKind ShapeVal,  //input - shape
	    float Val1,        //input - first dimension
	    float Val2);       //input - second dimension
  void ComputePerim();
  void ComputeArea();
  char *GetName();
  float GetArea();
  float GetPerim();
  float GetFirstVar();
  float GetSecondVar();
  void Display();
};
