public HocSinh HocSinh_CoTongDiem_Max()
        {
            if (List_hs_.Count == 0)
            {
                return(null);
            }
            HocSinh max = List_hs_.OrderByDescending(hs => hs.TinhTongDiem3Mon()).ToList().First();

            return(max);
        }
 public void Nhap_ThongTin_ListHocSinh()
 {
     Console.Write("Nhap so luong hoc sinh: ");
     SiSo = int.Parse(Console.ReadLine());
     for (var i = 0; i < this.SiSo; i++)
     {
         HocSinh hs = new HocSinh();
         hs.Nhap_ThongTin_HocSinh();
         Them_HocSinh(hs);
     }
 }
 public HocSinh Tim_ThongTin_HocSinh(String tt)
 {
     try
     {
         if (List_hs_.Count == 0)
         {
             return(null);
         }
         HocSinh hs = List_hs_.Find(hs => hs.MHS.ToUpper().Equals(tt.ToUpper()) || hs.HT.ToUpper().Equals(tt.ToUpper()));
         return(hs);
     }
     catch (ArgumentNullException e)
     {
         Console.Write("Exception Thrown: ");
         Console.Write("{0}", e.GetType(), e.Message);
     }
 }
예제 #4
0
        static void Main(string[] args)
        {
            LopHoc  lopHoc  = new LopHoc();
            HocSinh hocSinh = new HocSinh();
            String  tt;

            lopHoc.Nhap_ThongTin_ListHocSinh();
            lopHoc.Xuat_ThongTin_ListHocSinh();

            hocSinh = lopHoc.HocSinh_CoTongDiem_Max();
            hocSinh.Xuat_ThongTin_HocSinh();

            Console.Write("Nhap thong tin can tim (Ho va ten hoac ma so hoc sinh): ");
            tt      = Console.ReadLine();
            hocSinh = lopHoc.Tim_ThongTin_HocSinh(tt);
            hocSinh.Xuat_ThongTin_HocSinh();
            Console.ReadKey();
        }
 public void Them_HocSinh(HocSinh hs)
 {
     List_hs_.Add(hs);
 }