static void Main(string[] args)
        {
            Triangle triangle = new Triangle(5, 3);
            Square   square   = new Square(5, 5);

            //Use a collection of Shape objects and display their dimensions and area.

            triangle.CalculateArea();
            triangle.DisplayShapeData();

            square.CalculateArea();
            square.DisplayShapeData();
        }
예제 #2
0
파일: Program.cs 프로젝트: nok32/SoftUny-HW
        static void Main(string[] args)
        {
            var circle = new Circle(5);
            Console.WriteLine(circle.CalculateArea());
            Console.WriteLine(circle.CapculatePerimeter());

            var triangle = new Triangle(2, 2);
            Console.WriteLine(triangle.CalculateArea());
            Console.WriteLine(triangle.CapculatePerimeter());

            var rectangle = new Rectangle(3, 3);
            Console.WriteLine(rectangle.CalculateArea());
            Console.WriteLine(rectangle.CapculatePerimeter());
        }
예제 #3
0
        static void Main(string[] args)
        {
            var circle = new Circle(5);

            Console.WriteLine(circle.CalculateArea());
            Console.WriteLine(circle.CapculatePerimeter());

            var triangle = new Triangle(2, 2);

            Console.WriteLine(triangle.CalculateArea());
            Console.WriteLine(triangle.CapculatePerimeter());

            var rectangle = new Rectangle(3, 3);

            Console.WriteLine(rectangle.CalculateArea());
            Console.WriteLine(rectangle.CapculatePerimeter());
        }
예제 #4
0
        public void TestTriangleCalculateArea()
        {
            Triangle r = new Triangle(2.1, 39);

            Assert.AreEqual(40.95, r.CalculateArea());
        }