示例#1
0
        static void Main()
        {
            Console.WriteLine(CalcTriangleArea(3, 4, 5));

            Console.WriteLine(DigitToStringName(5));

            Console.WriteLine(FindMaxValue(5, -1, 3, 2, 14, 2, 3));

            PrintAsNumber(1.3, "f");
            PrintAsNumber(0.75, "%");
            PrintAsNumber(2.30, "r");

            var    testPointOne = new TestPoint(3, -1);
            var    testPointTwo = new TestPoint(3, 2.5);
            double testDistance = CalcDistance(
                testPointOne.CoordX,
                testPointOne.CoordY,
                testPointTwo.CoordX,
                testPointTwo.CoordY
                );
            bool isHorizontal = IsHorizontal(testPointOne.CoordY, testPointTwo.CoordY);
            bool isVertical   = IsVertical(testPointOne.CoordX, testPointTwo.CoordX);

            Console.WriteLine(testDistance);
            Console.WriteLine("Horizontal? " + isHorizontal);
            Console.WriteLine("Vertical? " + isVertical);

            Student peter = new Student()
            {
                FirstName = "Peter", LastName = "Ivanov"
            };

            peter.OtherInfo = "From Sofia, born at 17.03.1992";

            Student stella = new Student()
            {
                FirstName = "Stella", LastName = "Markova"
            };

            stella.OtherInfo = "From Vidin, gamer, high results, born at 03.11.1993";

            Console.WriteLine("{0} older than {1} -> {2}",
                              peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
        }
示例#2
0
        static void Main()
        {
            Console.WriteLine(CalcTriangleArea(3, 4, 5));

            Console.WriteLine(DigitToStringName(5));

            Console.WriteLine(FindMaxValue(5, -1, 3, 2, 14, 2, 3));

            PrintAsNumber(1.3, "f");
            PrintAsNumber(0.75, "%");
            PrintAsNumber(2.30, "r");

            var testPointOne = new TestPoint(3, -1);
            var testPointTwo = new TestPoint(3, 2.5);
            double testDistance = CalcDistance(
                testPointOne.CoordX, 
                testPointOne.CoordY, 
                testPointTwo.CoordX, 
                testPointTwo.CoordY
                );
            bool isHorizontal = IsHorizontal(testPointOne.CoordY, testPointTwo.CoordY);
            bool isVertical = IsVertical(testPointOne.CoordX, testPointTwo.CoordX);
            Console.WriteLine(testDistance);
            Console.WriteLine("Horizontal? " + isHorizontal);
            Console.WriteLine("Vertical? " + isVertical);

            Student peter = new Student() { FirstName = "Peter", LastName = "Ivanov" };
            peter.OtherInfo = "From Sofia, born at 17.03.1992";

            Student stella = new Student() { FirstName = "Stella", LastName = "Markova" };
            stella.OtherInfo = "From Vidin, gamer, high results, born at 03.11.1993";

            Console.WriteLine("{0} older than {1} -> {2}",
                peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
        }