コード例 #1
0
ファイル: UtilsDemo.cs プロジェクト: petyob/TelerikAcademy
    /// <summary>
    /// The entry point of the program.
    /// </summary>
    private static void Main()
    {
        Console.WriteLine(GeometryUtils.CalcTriangleArea(3, 4, 5));

        Console.WriteLine(LanguageUtils.DigitToText(5));

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

        ConsolePrinter.PrintNumber(1.3, 2);
        ConsolePrinter.PrintPercent(0.75, 0);
        ConsolePrinter.PrintAligned(2.30, 8);

        Console.WriteLine(GeometryUtils.CalcDistance(3, -1, 3, 2.5));
        Console.WriteLine("Horizontal? " + GeometryUtils.IsLineHorizontal(3, -1, 3, 2.5));
        Console.WriteLine("Vertical? " + GeometryUtils.IsLineVertical(3, -1, 3, 2.5));

        Student peter = new Student()
        {
            FirstName = "Peter", LastName = "Ivanov", DateOfBirth = new DateTime(1992, 03, 17)
        };

        Student stella = new Student()
        {
            FirstName = "Stella", LastName = "Markova", DateOfBirth = new DateTime(1993, 11, 3)
        };

        Console.WriteLine(
            "Is {0} older than {1}? -> {2}",
            peter.FirstName,
            stella.FirstName,
            peter.DateOfBirth.IsEarlierThan(stella.DateOfBirth));
    }
コード例 #2
0
ファイル: MethodsDemo.cs プロジェクト: skirov/TA-CSharp
    /// <summary>
    /// The entry point of the program.
    /// </summary>
    private static void Main()
    {
        Student ivan = new Student();

        ivan.FirstName   = "Ivan";
        ivan.LastName    = "Ivanov";
        ivan.DateOfBirth = new DateTime(1992, 03, 17);

        Student ivanka = new Student();

        ivanka.FirstName   = "Ivanka";
        ivanka.LastName    = "Ivanova";
        ivanka.DateOfBirth = new DateTime(1993, 11, 3);

        Student asd = new Student();

        Console.WriteLine(
            "Is {0} older than {1}? -> {2}",
            ivan.FirstName,
            ivanka.FirstName,
            ivan.DateOfBirth.IsEarlierThan(ivanka.DateOfBirth));

        Console.WriteLine(GeometryMethods.CalcTriangleArea(3, 4, 5));

        Console.WriteLine(LanguageMethods.DigitToText(5));

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

        ConsolePrinter.PrintNumber(1.3, 2);
        ConsolePrinter.PrintPercent(0.75, 0);
        ConsolePrinter.PrintAligned(2.30, 8);

        Console.WriteLine(GeometryMethods.CalcDistance(3, -1, 3, 2.5));
        Console.WriteLine("Horizontal? -> " + GeometryMethods.IsLineHorizontal(3, -1, 3, 2.5));
        Console.WriteLine("Vertical? -> " + GeometryMethods.IsLineVertical(3, -1, 3, 2.5));
    }