Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            rect r = new rect()
            {
                x = 10, y = 20
            };

            Console.WriteLine("Area={0}", r.Area());
            DrawScreen.draw(r);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            shape c = new circ(2);

            Console.WriteLine("Circle= " + c.Area());
            shape r = new rect(2, 3);

            Console.WriteLine("Rectangle= " + r.Area());
            shape s = new squr(2);

            Console.WriteLine("Square= " + s.Area());
            shape t = new trin(2, 3);

            Console.WriteLine("Triangle= " + t.Area());
            geoShape total = new geoShape(c, r, s, t);

            Console.WriteLine("Total area= " + total.Area);
            Console.WriteLine("Total area= " + (c.Area() + r.Area() + s.Area() + t.Area()));
            Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            shape circ = new circ(2);

            Console.WriteLine("Circle= " + circ.Area());
            shape rect = new rect(2, 3);

            Console.WriteLine("Rectangle= " + rect.Area());
            shape squr = new squr(2);

            Console.WriteLine("Square= " + squr.Area());
            shape trin = new trin(2, 3);

            Console.WriteLine("Triangle= " + trin.Area());
            Console.ReadLine();
        }