예제 #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
파일: Program.cs 프로젝트: sree95/Learning
        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());
        }