Esempio n. 1
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();
        }
Esempio n. 2
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();
        }