/// <summary> /// 显示教职工; /// </summary> /// <param name="faculty">教职工</param> public static void Display(Faculty faculty) { WriteLine ($"教职工信息:\n" + $"工号:{faculty.Number,-15}姓名:{faculty.Name}\n" + $"性别:{faculty.Gender,-14}生日:{faculty.BirthDate:D}\n" + $"手机号:{faculty.PhoneNumber}\n" + $"部门:{faculty.Department}\n专长:{faculty.Speciality}"); faculty.Intro(); WriteLine("\n"); }
static void Main() { Faculty msYang = new Faculty("2002010", "杨雪梅", Gender.FEMALE, "人文与管理学院") { Speciality = "数据仓库与数据挖掘、医学统计" }; Student boy = new Student("3210707000", "张三", Gender.MALE); msYang.Intro(); //调用派生类重写的方法; boy.Intro(); Read(); }
static void Main() { Faculty msYang = new Faculty("2002010", "杨雪梅", Gender.FEMALE) { PhoneNumber = "13322223333" }; Student boy = new Student("3210707000", "张三", Gender.MALE) { PhoneNumber = "15955559999" }; msYang.Intro(); //调用基类的虚方法; boy.Intro(); msYang.SendSms("请抓紧登分。"); boy.SendSms("请抓紧评教。"); Read(); }
static void Main() { Faculty msYang = new Faculty("2002010", "杨雪梅", Gender.FEMALE, "人文与管理学院") { Speciality = "数据仓库与数据挖掘、医学统计" }; Undergraduate boy = new Undergraduate("3210707000", "张三", Gender.MALE, "21信管"); Postgraduate girl = new Postgraduate("2190757001", "李四", Gender.FEMALE, msYang); girl.AssignDirection("数据可视化"); ExchangeStudent newGuy = new ExchangeStudent("20200531001", "王五", Gender.MALE, "20信管", "江西中医药大学"); msYang.Intro(); boy.Intro(); girl.Intro(); newGuy.Intro(); Read(); }
static void Main() { Faculty mrLin = new Faculty("2004034", "林立", Gender.MALE) { BirthDate = new DateTime(1982, 4, 17), PhoneNumber = "13599995555", Department = "人文与管理学院", }; Student boy = new Student("3210707000", "张三", Gender.MALE) { BirthDate = new DateTime(2003, 1, 2), PhoneNumber = "18900001111", Class = "21信管", }; mrLin.Intro(); WriteLine($"目前任教于{mrLin.Department}。\n"); mrLin.SendSms("请及时阅卷。"); boy.Intro(); WriteLine($"目前就读于{boy.Class}。\n"); boy.SendSms("请及时评教。"); Read(); }