Пример #1
0
        static void Main(string[] args)
        {
            AbstractRegularPolygon p = new Triangle(2, "Red");

            p.test(4, 5);
            ICollection <IRegularPolygon> polygons = new List <IRegularPolygon>();

            var square = new Square(5);

            DisplayPolygon("Square", square);


            var triangle = new Triangle(5, "Red");

            DisplayPolygon("Triangle", triangle);

            var octagon = new Octagon(5);

            //DisplayPolygon("Octagon", octagon);

            polygons.Add(octagon);
            var pentagon = new Pentagon(5);

            polygons.Add(pentagon);

            foreach (var polygon in polygons)
            {
                DisplayPolygon(polygon.ToString(), polygon);
            }

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var square = new Square(5);

            DisplayPolygon("Square", square);
            var triangle = new Triangle(5);

            DisplayPolygon("Triangle", triangle);
            var octagon = new Octagon(5);

            DisplayPolygon("Octagon", octagon);
            Console.ReadKey();
        }
Пример #3
0
        static void Main(string[] args)
        {
            var square = new Square(5);

            DisplayDetails("Square", square);

            var triangle = new Triangle(5);

            DisplayDetails("Triangle", triangle);

            var octagon = new Octagon(5);

            DisplayDetails("Octagon", octagon);
        }
Пример #4
0
        static void Main(string[] args)
        {
            //Square
            //var square = new Square(14);
            //square.Display();

            //Triangle
            //var triangle = new Triangle(14);
            //triangle.Display();

            //Octagon
            var octagon = new Octagon(14);

            octagon.Display();

            Console.ReadLine();
        }
Пример #5
0
        static void Main(string[] args)
        {
            //Concrete Regular Example
            var square = new Square(5);

            DisplayPolygon("Square", square);

            //Abstract Class example
            var traingle = new Traingle(10);

            DisplayPolygon("Traingle", traingle);

            //Interface Example
            var octagon = new Octagon(8, 5);

            DisplayPolygon("Octagon", octagon);
            Console.Read();
        }
Пример #6
0
        static void Main(string[] args)
        {
            // using Concrete Class
            var square = new Square(5);

            DisplayPolygon("Square", square);

            // using Abstract Class
            var triangle = new Triangle(5);

            DisplayPolygon("Triangle", triangle);

            // using Interface
            var octagon = new Octagon(5);

            DisplayPolygon("Octagon", octagon);

            Console.Read();
        }
Пример #7
0
        static void Main(string[] args)
        {
            // Square
            Square sq = new Square(5);

            DisplayPolygon("Square", sq);

            // Triangle

            Triangle tri = new Triangle(5);

            DisplayPolygon("Triangle", tri);

            //Octogon

            Octagon oct = new Octagon(5);

            DisplayPolygon("Octagon", oct);
        }
Пример #8
0
        static void Main()
        {
            var octagon = new Octagon(3);

            Console.WriteLine(octagon.GetArea());
        }