PRN211_-_SU_2022_-_PE_-_Trial_2146.webp
H

PRN211_-_SU_2022_-_PE_-_Trial_2146.webp

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
Chưa có bình luận nào.

Thông tin

Category
PRN221
Thêm bởi
Hồng Anh
Ngày thêm
Lượt xem
467
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRN211_-_SU_2022_-_PE_-_Trial_2146.webp
File size
191.1 KB
Dimensions
1920px x 1050px

Share this media

Back
Bên trên Bottom