Zoom
4
{
5
6
{
7
8
9
10
11
12
13
14
15
16
Using everything you have defined, the class Program below (Figure 1) will produce the result as shown in Figure 2. Note that: Note that two students are considered equal if all their information are the same.
3 internal class Program
private static void Main(string[] args)
Console.WriteLine("Requirement 1:");
Students = new Student(1, "Nguyen Van A", new DateTime (1999, 10, 20), "SE");
Console.WriteLine("You have entered:");
Console.WriteLine(s);
Console.WriteLine(Environment.NewLine +
Console.WriteLine("Requirement 2:");
Group<Student> group new Group<Student>("SE1824");
-");
group.Add(new Student(2, "Nguyen Van B", new DateTime(1999, 10, 20), "SE"));
group.Add(new Student(3, "Nguyen Van C", new DateTime(1989, 11, 15), "IA"));group.Add(new Student(4, "Nguyen Van D", new DateTime(2000, 4, 2), "GD"));
17
18
group.Show(DisplaysFullInfo0fStudent);
19
28
Console.WriteLine(Environment.NewLine Console.WriteLine("Requirement 3:");
-");
21
22
23
24
25
26
27
28
29
}
30
31
32
{
33
Student removeStudent new Student(3, "Nguyen Van C", new DateTime(1989, 11, 15), "IA");
group. Remove (removeStudent);
group.Show(DisplaysFullInfo0fStudent);
Console.WriteLine(Environment.NewLine ");
Console.WriteLine("Requirement 4:");group.Show(DisplaysBriefInfo0fStudent);
private static void DisplaysFullInfoOfStudent(Student student)
Console.WriteLine($" {student.Id} {student.Name} {student. Dob.ToLongDateString()} {student.Major}");
34
}
35
+ 115%
Close