Computer Science, asked by prabsmorajkar007, 3 months ago

Write a program to Define a class employee which will contain member variables basic, TA, DA, HRA. Write a program using constructor with default values of HRA and DA and calculate the Gross salary of employee.


Answers

Answered by cwiclashwithindians
3

Answer:

using system;

class salary

{

string ename;

float bsal; hra; da; pf;

void read();

{

console.WriteLine("Enter the Employee Name");

bsal=float.pase(console.ReadLine());

}

float sal()

{

float nsal

hra=20*bsal/100;

da=10*bsal/100;

pf=15*bsal/100;

gsal=bsal+da+hra+pf;

return gsal

}

static void main()

{

salary s=new salary();

s.read();

float n=s.cal();

console.WriteLine("Gross Salary is",+gsal);

}

}

please rate us if it will help

Similar questions