Visual Programming (CS411) : Assignment # 02
Visual Programming (CS411) : Assignment # 02
Lectures:
Lectures 7 to 15
NOTE
No assignment will be accepted after the due date via email in any case (whether it is the case of load
shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of
deadline. It is recommended to upload solution file at least two days before its closing date.
If you people find any mistake or confusion in assignment (Question statement), please consult with your
instructor before the deadline. After the deadline no queries will be entertained in this regard.
For any query, feel free to email at: [email protected]
(Marks 20)
Problem Statement:
You need to develop a console application in C# using delegates and event handling that will display how
many digits of your VU Id have been added to the ArrayList.
There should be two classes one is publisher and other is listener.
In publisher class, define the event along the method that where you will fire the event.
For example, define MyArrayList class in your code. Your MyArrayList should inherit from
built-in ArrayList class.
Now, according to the functionality of given problem statement identify and define your
event. Also define a method where you will fire a particular event.
In Publisher class, override base class method (Add) to add the digits of your VU-Id into an
ArrayList.
Now in listener class write the handler where you will display the count of your VU-Id that is
already added to an ArrayList.
In main method of your listener class, register your already defined event to handler. Then
call an overridden method of publisher class to add your VU-Id into the ArrayList. Your
handler should display the count after every addition to ArrayList.
Remember your event should be fired every time you add a digit into an ArrayList.
In this program, you will use the built-in ArrayList class. For that you have to add library
System.Collections;
Required Output:
Your output should be like this:
Note:
DO REMEMBER that you must use your VUID as an input in this program.
Submission details
Following Files Must be submitted in a single zip or rar file.
.C# code file (file name should be your VUID)
Screenshot of your output
You are not required to submit the complete project, only copy required file from project
folder.
If you do not submit any of the above-mentioned file you will be awarded Marks partially.
“The End”