Пример #1
0
        static void Main(string[] args)
        {
            Program program = new Program();
            User    user    = new User();

            Console.Write("Enter name first and last name: ");
            user.name = Console.ReadLine();
            program.CheckBirthday(user);
            user.daysUntilBirthday = program.DaysUntilBirthday(user.birthDate);
            user.age = program.CalculateAge(user.birthDate);
            Console.Write("Enter gender: ");
            user.gender    = program.CheckGender();
            user.firstName = user.name.Split(' ')[0];
            if (user.name.Split(' ').Length > 1)
            {
                user.lastName = user.name.Split(' ')[1];
            }
            else
            {
                user.lastName = user.name.Split(' ')[0];
            }
            if (user.gender == User.Gender.Male)
            {
                user.pronoun = "Mr";
            }
            else
            {
                user.pronoun = "Mrs";
            }
            Console.WriteLine($"Hello {user.pronoun}. {user.lastName}, I see you’re currently {user.age} years old, and your birthday is {user.daysUntilBirthday} days away!");
        }