Пример #1
0
        public static Botan CreatePair(CoolParent parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("null parent");
            }
            Sex randomSex = Randomizer.GetRandomSex();

            return(new Botan(Randomizer.GetRandomStudentAge(), NamesHelper.GenerateName(randomSex), randomSex, NamesHelper.PatronymicFromName(randomSex, parent.Name), MoneyHelper.MoneyToMark(parent.Money)));
        }
Пример #2
0
        public static CoolParent CreatePair(Botan student)
        {
            if (student == null)
            {
                throw new ArgumentNullException("null student");
            }
            if (student.Patronymic.Length < 5)
            {
                throw new ArgumentException("Too short patronymic name");
            }

            var name = NamesHelper.NameFromPatronymic(student.Sex, student.Patronymic);

            return(new CoolParent(Randomizer.GetRandomParentAgeFromStudent(student.Age), name, Sex.Man, 1 + rnd.Next(maxChildsNum - 1), MoneyHelper.MarkToMoney(student.AverageMark))); // he surely has 1 child
        }