Пример #1
0
        static void Main(string[] args)
        {
            //Task1
            Colour colour1 = new Colour(21, 42, 84, "Goo");
            Colour colour2 = new Colour(76, 49, 24, "Crayon");

            Cookie c1 = new Cookie(52, "round", colour1);
            Cookie c2 = new Cookie(26, "square", colour1);
            Cookie c3 = new Cookie(72, "circle", colour2);
            Cookie c4 = new Cookie(12, "box", colour2);

            //Task2
            Random IdGenerator = new Random();

            Person p1 = new Person("Jason", "Statham", "30th August 1973", 182, IdGenerator.Next(1000, 10000));
            Person p2 = new Person("John", "Doe", "25th September 1984", 171, IdGenerator.Next(1000, 10000));
            Person p3 = new Person("Kathy", "Bourne", "2nd March 2001", 156, IdGenerator.Next(1000, 10000));

            System.Console.WriteLine(p1.GetFullName());
            System.Console.WriteLine(p2.GetFullName());
            System.Console.WriteLine(p3.GetFullName());

            System.Console.WriteLine(p1.GetHeightDifference(p2));
            System.Console.WriteLine(p1.GetHeightDifference(p3));
            System.Console.WriteLine(p3.GetHeightDifference(p2));

            Person.Subject s1 = new Person.Subject("Mathematics", 2020);
            Person.Subject s2 = new Person.Subject("English", 2018);

            p2.Subjects(s1);
            p2.Subjects(s2);
        }
Пример #2
0
        static void Main(string[] args)
        {
            var p1 = new Person("Matthew", "Jester", DateTime.Parse("1994 03 14"), 155);
            var p2 = new Person("Ben", "Gardiner", DateTime.Parse("1900 01 01"), 180);
            var p3 = new Person("Tim", "Baird", DateTime.Parse("1900 01 01"), 160);

            Console.WriteLine(p1.GetfullName());
            Console.WriteLine(p1.GetHeightDifference(p2));
            p1.AddSuject("poopface", 1913);
            p1.AddSuject("facepalm", 2020);
            Console.WriteLine(p1.Tester());
        }