Пример #1
0
        public void Run()
        {
            while (this.isRunning)
            {
                string[] lineArgs = Console.ReadLine().Split();

                if (lineArgs[0] == "End")
                {
                    this.isRunning = false;
                    continue;
                }

                IBirthable newMember = SocietyMemberFactory.GetMember(lineArgs);

                if (newMember != null)
                {
                    manager.AddMember(newMember);
                }
            }

            // Get all members with birth year
            string birthYear = Console.ReadLine();

            // Print result
            Console.WriteLine(manager.GetMembersWithBirthYear(birthYear).Trim());
        }
Пример #2
0
        public void Run()
        {
            while (this.isRunning)
            {
                string[] lineArgs = Console.ReadLine().Split();

                if (lineArgs[0] == "End")
                {
                    this.isRunning = false;
                    continue;
                }

                IDable newMember = SocietyMemberFactory.GetMember(lineArgs);

                manager.AddMember(newMember);
            }

            // Get all members with ID -ending with
            string endindWithString = Console.ReadLine();

            // Print result
            Console.WriteLine(manager.GetMembersWithIdEndingWith(endindWithString));
        }