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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started