Exemple #1
0
        static void Main()
        {
            Rhombus newRhombus = new Rhombus(3, 2);

            Console.WriteLine(newRhombus.CalculatePerimeter());
            Console.WriteLine(newRhombus.CalculateArea());

            Console.WriteLine();
            //tuk zaradi nqkolkoto ctor-a mi dava da si izbiram dali da vuvejdam samo side
            // edno ili side1+2 ...
            Parallelogram newParallelogram = new Parallelogram(2, 4, 3);

            Console.WriteLine(newParallelogram.CalculateArea());
            Console.WriteLine(newParallelogram.CalculatePerimeter());

            Console.WriteLine();

            Rectangle newRectangle = new Rectangle(2, 4);

            Console.WriteLine(newRectangle.CalculatePerimeter());
            Console.WriteLine(newRectangle.CalculateArea());

            Console.WriteLine();

            Square newSquare = new Square(2);

            Console.WriteLine(newSquare.CalculatePerimeter());
            Console.WriteLine(newSquare.CalculateArea());
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var square = new Square(5.5);

            Console.WriteLine(square.Area());
            Console.WriteLine(square.CalculatePerimeter());
            Console.WriteLine(square.Draw());

            Console.WriteLine();

            var rectangle = new Rectangle(1.2, 5.5);

            Console.WriteLine(rectangle.Area());
            Console.WriteLine(rectangle.CalculatePerimeter());
            Console.WriteLine(rectangle.Draw());
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var kocka    = new Square(6);
            var plostina = kocka.CalculateArea();
            var obikolka = kocka.CalculatePerimeter();

            Console.WriteLine("Plostinata e {0}, a obikolkata {1}", plostina, obikolka);

            var    pravoagolnik  = new Rectangle(4, 9);
            double plostina2     = pravoagolnik.CalculateArea();
            double obikolka2     = pravoagolnik.CalculatePerimeter();
            var    dijagonala    = pravoagolnik.CalculateDiagonal();
            var    podolgastrana = pravoagolnik.LongerSide();

            Console.WriteLine("Plostinata na pravoagolnikot e {0}, negovata obikolka {1}, dijagonalata mu e {2}, a pogolemata strana mu e {3}", plostina2, obikolka2, dijagonala, podolgastrana);
            Console.ReadLine();
        }