Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS411 Visual Programming Assignment No 02 Fall 2020 Solution / Discussion

Visual Programming (CS411)

Assignment # 02

Total marks = 20

Due Date 14th Dec, 2020

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING

It should be clear that your assignment would not get any credit if:

  • The assignment is submitted after the due date.
  • The submitted assignment does not open or file is corrupt.
  • Strict action will be taken if submitted solution is copied from any other student or from the internet.

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:  cs411@vu.edu.pk

   (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 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”

Views: 1760

Replies to This Discussion

good solution file mangi ....assignment required file nhi

plese send code file

CS411 Assignment 2 Fall 2020 Solution idea:

Code:

using system;

using sysstem.Collection;




public delegate bool MyDelegate(object obj1);




namespace cs411_assignment_2_soltion

{

public class MyArraylist : ArrayList

{

public strin vu_id;

public static bool retVal;





public MyArrayList(string vuID)

{

String n1 = ((MyArrayList)my_vu_ID).vu_id;

char[] myID = n1 TocharArray();

foreach(char ch in myID)

{

if (ch < '0' || '9' > ch)

{

retVal = true;

}

else

{

retVal = false;

}

}

return retVal;

}

}

class MyListner {

MyArray[] names = new MyArrayList[11];

public MyListner()

{

ID_Val[0] = new MyArrayList("B");

ID_Val[1] = new MyArrayList("C");

ID_Val[2] = new MyArrayList("1");

ID_Val[3] = new MyArrayList("9");

ID_Val[4] = new MyArrayList("0");

ID_Val[5] = new MyArrayList("8");

ID_Val[6 = new MyArrayList("4");

ID_Val[7] = new MyArrayList("5");

ID_Val[8] = new MyArrayList("1");

ID_Val[9] = new MyArrayList("0");

ID_Val[10] = new MyArrayList("6");

}

statics void Main(string[] args)

{

MyListner m1 = new MyListner();



MyDelegate dg = new MyDelegate(MyArrayList.Add);



m1.checkingMyArrayList(dg);

}



//observe the delegate parameter

public void CheckingArrayList(MyDelegate my_id)

{

for(int i=0; i<ID_Val.Length; i++)

{

if(my_id(ID_Val[i]) == true)

{

j++;

console.WriteLine("Number of Digits of your VU ID added : "+(j));

}



}

}

}

}

CS411 assignment no 02 solution fall 2020

Click on the below link to download the file

CS411_Assignment_No_02_Solution_Fall_2020

cs411 right solution fall 2020

Click on the below link to download the file

CS411-Right-Solution-Fall-2020-Assignment-02

CS411 - Assignment 2 solution fall 2020
with source code
100% correct solution. Enjoy!

#CS411 #cs411assignmentsolution2 #vu
cs411 assignment 2 solution fall 2020

cs411 assignment 2 solution fall 2020 cs411 assignment 2 solution cs411 assignment 2 solution 2020 cs411

cs411 assignment no 02 solution link 

https://www.dropbox.com/s/184munth84omuvc/cs411.docx?dl=0 

cs411 assignment no 02 solution link 

https://www.dropbox.com/s/184munth84omuvc/cs411.docx?dl=0 

cs411 assignment no 02 solution fall 2020

using System;

 

using System.Collections;

 

public delegate bool MyDelegate(object obj1);

namespace cs4111

{

    public class MyArrayList : ArrayList

    {

        public string vu_id;

        public static bool retVal;

 

        public MyArrayList(string vuID)

        {

            vu_id = vuID;

        }

        public static bool Add(object my_vu_ID)

        {

            string alist = ((MyArrayList)my_vu_ID).vu_id;

            char[] myID = alist.ToCharArray();

            foreach (char ch in myID)

            {

                if (ch < '0' || '9' > ch)

                {

                    retVal = true;

                }

                else

                {

                    retVal = false;

                }

            }

            return retVal;

        }

    }

    class MyListner

    {

        MyArrayList[] ID_Val = new MyArrayList[11];

        public MyListner()

            {

                        ID_Val[0] = new MyArrayList("B");

                        ID_Val[1] = new MyArrayList("C");

                        ID_Val[2] = new MyArrayList("1");

                        ID_Val[3] = new MyArrayList("5");

                        ID_Val[4] = new MyArrayList("0");

                        ID_Val[5] = new MyArrayList("4");

                        ID_Val[6] = new MyArrayList("0");

                        ID_Val[7] = new MyArrayList("1");

                        ID_Val[8] = new MyArrayList("2");

                        ID_Val[9] = new MyArrayList("4");

                        ID_Val[10] = new MyArrayList("7");

}

 

        static void Main(string[] args)

        {

            MyListner ml = new MyListner();

            MyDelegate dg = new MyDelegate(MyArrayList.Add);

            ml.CheckingMyArrayList(dg);

        }

 

        public void CheckingMyArrayList(MyDelegate my_id)

        {

            int j = 0;

            for (int i = 0; i < ID_Val.Length; i++)

            {

                if (my_id(ID_Val[i]) == true)

                {

                    j++;

                    Console.WriteLine("Number of Digits Of your VU ID Added :" + (j));

                    Console.ReadKey();

                }

            }

        }

    }

}

 

CS411 Assignment 2 Solution idea 2:

Please check this code:

 

using system;

using sysstem.Collection;





public delegate bool MyDelegate(object obj1);





namespace

{

public class MyArraylist : ArrayList

{

public strin vu_id;

public static bool retVal;







public MyArrayList(string vuID)

{

String n1 = ((MyArrayList)my_vu_ID).vu_id;

char[] myID = n1 TocharArray();

foreach(char ch in myID)

{

if (ch < '0' || '9' > ch)

{

retVal = true;

}

else

{

retVal = false;

}

}

return retVal;

}

}

class MyListner {

MyArray[] names = new MyArrayList[11];

public MyListner()

{

ID_Val[0] = new MyArrayList("B");

ID_Val[1] = new MyArrayList("C");

ID_Val[2] = new MyArrayList("1");

ID_Val[3] = new MyArrayList("6");

ID_Val[4] = new MyArrayList("0");

ID_Val[5] = new MyArrayList("4");

ID_Val[6 = new MyArrayList("0");

ID_Val[7] = new MyArrayList("0");

ID_Val[8] = new MyArrayList("6");

ID_Val[9] = new MyArrayList("6");

ID_Val[10] = new MyArrayList("3");

}

statics void Main(string[] args)

{

MyListner m1 = new MyListner();




MyDelegate dg = new MyDelegate(MyArrayList.Add);




m1.checkingMyArrayList(dg);

}




//observe the delegate parameter

public void CheckingArrayList(MyDelegate my_id)

{

for(int i=0; i<ID_Val.Length; i++)

{

if(my_id(ID_Val[i]) == true)

{

j++;

console.WriteLine("Number of Digits of your VU ID added : "+(j));

}




}

}

}

}

CS411 Assignment Solution # 2 Fall 2020 - Visual Programming

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service