public class SchoolEmployee
public string Name {get; set;}
protected string EmployeeID {get; set;}
if (value >= 30000 && value <= 100000)
private int JoinYear{get; set; }
public SchoolEmployee() {}
public SchoolEmployee(string n, string e, int s, int j)
Console.WriteLine("Employee's Name: "+ Name);
return DateTime.Now.Year - JoinYear + 1;
string JobType{get; set;}
public class Teacher : SchoolEmployee, IJob
public string Department {get; set;}
public string JobType {get; set; }
public Teacher(string n, string e, int s, int j, string d, string t) : base(n, e, s, j)
public new void PrintName()
Console.WriteLine("Teacher's Name: "+ Name);
public bool IsAccountingJob()
if (JobType == "accounting")
public string CourseName {get; set;}
public string CourseID {get; set;}
public Teacher CourseTeacher{get; set;}
public Course(string n, string id, Teacher t)
public bool HighExperience()
if (CourseTeacher.Tenure() > 10)
public static void Main()
Teacher liu = new Teacher("liu", "A1234", 6000, 2018, "ODT", "accounting");
Course s308 = new Course("C#", "S308", liu);
Console.WriteLine("Course Name: " + s308.CourseName);
Console.WriteLine("High Experience: " + s308.HighExperience());
Console.WriteLine("Is Accounting Job: " + liu.IsAccountingJob());
Console.WriteLine("Bonus: " + liu.ShowBonus());
s308.CourseTeacher.PrintName();