Example #1
0
        static void Main(string[] args)
        {
            SquareShape   square   = new SquareShape();
            TriangleShape triangle = new TriangleShape();
            CircleShape   circle   = new CircleShape();

            float side = 5;

            square.sideLenght   = side;
            triangle.sideLenght = side;
            circle.radius       = side;

            square.Init();
            triangle.Init();
            circle.Init();

            square.Perimetr();
            triangle.Perimetr();
            circle.Perimetr();

            square.Square();
            triangle.Square();
            circle.Square();

            Console.WriteLine("SquareShape");
            Console.WriteLine("perimetr: {0}", square.perimetr);
            Console.WriteLine("square: {0}", square.square);

            Console.WriteLine("TriangleShape");
            Console.WriteLine("perimetr: {0}", triangle.perimetr);
            Console.WriteLine("square: {0}", triangle.square);

            Console.WriteLine("CircleShape");
            Console.WriteLine("perimetr: {0}", circle.perimetr);
            Console.WriteLine("square: {0}", circle.square);
        }