With the main function given in Figure 1 below, your code must have the same result as the Figure 2.
(You can find this code in the Given Materials.)
static void Notify(int oldNumber, int newNumber)
{
Console.WriteLine($"Number of student has changed from (oldNumber} to {newNumber).");}
O references static void Main(string[] args)
{
Students = new Student(1, "Trung");
Coursec new Course (1, "PRN211_Sum21");
c.AddStudent(s, 7.5);
c.AddStudent(new Student(2, "Hoa"), 7.8);
Console.WriteLine(c);c.RemoveStudent(2);
c.AddStudent(new Student(3, "Vinh"), 7.4);
Console.WriteLine(c);
Console.WriteLine("After remove:");
Console.WriteLine("-After add event handler:");
c.OnNumberOfStudentChange += Notify;
c.AddStudent(new Student(4, "Hoang Anh"), 8);
c.RemoveStudent(1);
Console.WriteLine(c);
Console.ReadLine();
Figure 1: Main function
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
}
The output should be the same as below
Zoom
+ 100%
Close