0% found this document useful (0 votes)
10 views

C# Programming

The document defines classes for member, manager, and employee. It includes properties like name, age, number, salary and methods like printsalary() and off() to output details. On button click, it creates a manager object and calls printsalary() to display values from textboxes.

Uploaded by

Varshini Varsha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

C# Programming

The document defines classes for member, manager, and employee. It includes properties like name, age, number, salary and methods like printsalary() and off() to output details. On button click, it creates a manager object and calls printsalary() to display values from textboxes.

Uploaded by

Varshini Varsha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

class member

{
public string name, address;
public int age;
public long number, salary;
public void printsalary( string n, int a, long num, string add, long sal )
{
name= n;
age= a;
number= num;
address= add;
salary= sal;
}
public string printsalary( long sal)
{
return salary + " " ;I
}
}
n
private void buttonl_Click(object sender, EventArgs e)
{
member m = new member () ;
m.printsalary((textBoxl .Text), (int . Parse(textBox2 . Text)), (long .Parse(textBox3.Text)) ,
MessageBox .show(m.printsalary( long .Parse(textBoxS . Text)));
}
}
o;} Form1 D X

NAME SUHAYLA

AGE 22
X

PHONE NO 78451 29632 50000

ADDRESS TAMBARAM OK

:B
SALARY 50000

submit
class member
{
public string name, address;
public int age;
public long number, salary;
virtual public string printsalary( string n, int a, long num, string add, long sal )
{
name= n;
age= a;
number= num;
add ress= add;
s alary = sal;
return "name" + "\n " +a+ "\n" + num + "\n " + "address " + "\ n" + sal;

}
}
class manager :member
{
public string ~ , ~ ;
override public string printsalary( string n, int a, long num, string add, l ong sal)
{
return "spec" + " \ n" + "depart" ;
}
}
. , ,--.. . --- ---t'-
class employee : member
{
public string s pec, depart;
virtual public string off( string spec, string depart)
{

ret urn "spec" + "\ n" + "depart" ;


}
}
publi c Forml ()
{
InitializeComponent ();
}

private void buttonl_Click( obj ect sender, EventArgs e )


{
member m = new manager() ;
I MessageBox .Show( m.printsalary((textBoxl.Text), (int .Parse (textBox2.Text )) , (long .Parse

}
o'] Forml D X

NAME ayman _ _ _ _ _ __

AGE 25

PHONE NO 7945612387 n:Box4. Te


X

ADDRESS chennai spec


depart

SALARY 45000 OK

submit

You might also like