public void Nhap() { Console.Write("Nhap so hoc sinh: "); shs = int.Parse(Console.ReadLine()); dshs = new HocSinh[shs]; for (int i = 0; i < shs; i++) { dshs[i] = new HocSinh(); dshs[i].Nhap(); } }
private void btnThem_Click(object sender, EventArgs e) { string hoTen = txtHoTen.Text; string gioiTinh = "Nam"; if (chkNu.Checked) { gioiTinh = "Nữ"; } double toan = double.Parse(txtToan.Text); double van = double.Parse(txtVan.Text); double ngoaiNgu = double.Parse(txtNgoaiNgu.Text); HocSinh hs1 = new HocSinh(hoTen, gioiTinh, toan, van, ngoaiNgu); dsHocSinh.Add(hs1); lbCount.Text = dsHocSinh.Count.ToString(); }