Savitribai Phule Pune University T.Y.B.B.A.(C.A.) Dot Net Framework Practical Slip 14 Answers

  Dot Net Framework


 Dot Net Framework

A) Write a program in C#.Net to find the sum of all elements of the array.

Answer :

namespace WinFormsApp27

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            listBox1.Items.Add(textBox1.Text);

        }

 

        private void button2_Click(object sender, EventArgs e)

        {

            int a,b=0,c;

            for(int i = 0; i < listBox1.Items.Count; i++)

            {

                a = Convert.ToInt32(listBox1.Items[i]);

                c = a + b;

                b = c;

            }

            MessageBox.Show("Addtion is : " + b);

 

        }

    }

}

Output :

 

Write a program in C#.Net to find the sum of all elements of the array.

B) Write a C#.Net Program to define a class Person having members –name, address.

Create a subclass called employee with member staffed, salary. Create ‘n’ objects of the

Employee class and display all the details of the Employee.

Answer :

Output :


Savitribai Phule Pune University T.Y.B.B.A.(C.A.) Dot Net Framework Practical Slip 14 Answers Savitribai Phule Pune University T.Y.B.B.A.(C.A.) Dot Net Framework Practical Slip 14 Answers Reviewed by technical_saurabh on May 02, 2022 Rating: 5

No comments:

Powered by Blogger.