Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var s = new Square(4);
            var c = new Circle(2);

            WriteLine(GeometricUtilities.ComputeArea(s));
            WriteLine(GeometricUtilities.ComputeArea(c));

            WriteLine(GeometricUtilities.ComputeAreaModernIs(s));
            WriteLine(GeometricUtilities.ComputeAreaModernIs(c));

            WriteLine(GeometricUtilities.ComputeArea_Version3(s));
            WriteLine(GeometricUtilities.ComputeArea_Version3(c));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var s = CreateShape("square");
            var c = CreateShape("circle");

            WriteLine(GeometricUtilities.ComputeArea(s));
            WriteLine(GeometricUtilities.ComputeArea(c));

            WriteLine(GeometricUtilities.ComputeAreaModernIs(s));
            WriteLine(GeometricUtilities.ComputeAreaModernIs(c));

            WriteLine(GeometricUtilities.ComputeArea_Version3(s));
            WriteLine(GeometricUtilities.ComputeArea_Version3(c));

            var what = CreateShape("       ");

            WriteLine(what);

            var wrong = CreateShape("trapezoid");

            WriteLine(wrong);
        }