Question: C#: Create a delegate called UpdateGpaDelegate. Next, create a class called Student with id, name, and gpa fields. The class also includes an event that
C#:
Create a delegate called UpdateGpaDelegate. Next, create a class called Student with id, name, and gpa fields. The class also includes an event that is of the UpdateGpaDelegate type. When a student's gpa is increased, it will be displayed in red font. When a student's gpa is decreased, it will display the font in blue.
Demonstrate the class by creating three student objects with data you make up. Display the student data on the console screen. Then, update each student's gpa. Make sure that one student's gpa is increased, one decreased, and one not changed. Finally, display the student data again. You should see the font change to red for the first student, blue for the second, and the normal color for the last student. (Hint: use two events, one to handle gpa increases, the other to handle gpa decreases).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
