Пример #1
0
        static void Main(string[] args)
        {
            rectangle a = new rectangle(int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine()));

            a.findperi();
            a.findarea();
            Console.WriteLine(a);
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            circle    c = new circle();
            rectangle r = new rectangle();
            driver    d = new driver();

            d.calculate(c);
            d.calculate(r);
            Console.ReadLine();
        }
Пример #3
0
        public static void Main()
        {
            imp ob;

            ob = new rectangle();
            ob.get();
            ob.area();
            ob.display();

            ob = new square();
            ob.get();
            ob.area();
            ob.display();
        }
Пример #4
0
        static void Main(string[] args)
        {
            var shape1 = new Shape();

            shape1.x      = 10;
            shape1.y      = 20;
            shape1.height = 30;
            shape1.with   = 40;


            var circle1 = new Circle();

            circle1.x      = 5;
            circle1.y      = 10;
            circle1.height = 20;
            circle1.with   = 80;

            var rectangle1 = new rectangle();

            rectangle1.x      = 20;
            rectangle1.y      = 20;
            rectangle1.height = 5;
            rectangle1.with   = 6;

            var traingle1 = new traingle();

            traingle1.x      = 3;
            traingle1.y      = 2;
            traingle1.height = 4;
            traingle1.with   = 5;

            var shapes = new List <Shape>();

            shapes.Add(shape1);
            shapes.Add(circle1);
            shapes.Add(rectangle1);
            shapes.Add(traingle1);

            foreach (var item in shapes)
            {
                Console.WriteLine("preforming task");
            }

            Console.ReadLine();
        }