Пример #1
0
        private static void Main()
        {
            var peter = new Student("Peter", "Ivanov", "17.03.1992", "From Sofia");

            var stella = new Student("Stella", "Markova", "03.11.1993", "From Vidin, gamer, high results");

            Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
        }
Пример #2
0
        public static void Main()
        {
            // I'm using American settings, that's why the month goes first when parsing to DateTime
            Student peter = new Student("Peter", "Ivanov", "Sofia", DateTime.Parse("03.17.1992"));
            Student stella = new Student("Stella", "Markova", "Vidin", DateTime.Parse("11.03.1993"));

            stella.AdditionalInfo = "gamer, high results";

            Console.WriteLine(
                "{0} older than {1} -> {2}",
                peter.FirstName,
                stella.FirstName,
                peter.IsOlderThan(stella));
        }
Пример #3
0
        public static void Main()
        {
            // I'm using American settings, that's why the month goes first when parsing to DateTime
            Student peter  = new Student("Peter", "Ivanov", "Sofia", DateTime.Parse("03.17.1992"));
            Student stella = new Student("Stella", "Markova", "Vidin", DateTime.Parse("11.03.1993"));

            stella.AdditionalInfo = "gamer, high results";

            Console.WriteLine(
                "{0} older than {1} -> {2}",
                peter.FirstName,
                stella.FirstName,
                peter.IsOlderThan(stella));
        }
Пример #4
0
        public static void Main()
        {
            var peter = new Student("Peter", "Ivanov", new DateTime(1992, 03, 17))
            {
                AdditionalInfo = "From Sofia."
            };

            var stella = new Student("Stella", "Markova", new DateTime(1993, 11, 03))
            {
                AdditionalInfo = "From Vidin, gamer, high results."
            };

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