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 emp, int s, int y)
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 emp, int s, int y, string dept, string job) : base(n, emp, s, y)
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 cname, string cid, Teacher cteach)
public bool HighExperience()
if(CourseTeacher.Tenure() > 10)
public static void Main()
Teacher myTeacher = new Teacher("liu", "A1234", 60000, 2018, "ODT", "accounting");
Course c1 = new Course("C#", "S308", myTeacher);
Console.WriteLine("Course Name: " + c1.CourseName);
Console.WriteLine("Does course teacher have high experience? " + c1.HighExperience());
Console.WriteLine("Is the job accounting? " + c1.CourseTeacher.IsAccountingJob());
Console.WriteLine("Bonus: " + c1.CourseTeacher.ShowBonus());
c1.CourseTeacher.PrintName();