Example #1
0
    public bool Teach(LanguageStudent student, string language)
    {
        student.Languages.Add(language);

        if (Languages.Where(l => l == language).Any())
        {
            return(true);
        }

        return(false);
    }
Example #2
0
    public static void Main(string[] args)
    {
        LanguageTeacher teacher = new LanguageTeacher();

        teacher.AddLanguage("English");

        LanguageStudent student = new LanguageStudent();

        teacher.Teach(student, "English");

        foreach (var language in student.Languages)
        {
            Console.WriteLine(language);
        }
    }