Write a program to accept "n" employee names and their salary details(Basic,HRA,DA).calc the total salary of each Employee
Answers
PYTHON Programme :-
:// computeSalary( basic, grade):
hra = 5.2 * basic
da = 2.3 * basic
pf = 0.98 * basic
/Condition to compute the
allowance for the person
if grade == 'A':
allowance = 500
elif grade == 'B':
allowance = 700
else:
allowance = 900;
gross = round(basic + hra + da +
allowance - pf)
return gross ://
basic = 87858
grade = 'A'
Function call ://
print(computeSalary(basic, grade)); //}
- For n employee do similarly again
_____________________________________
Result Of programme :-
Here, HRA = 24% of Basic
- DA = 46% of basic
- Allow = 500 if grade = ‘A’
- Allow = 700 if grade = ‘B’
- Allow = 900 if grade = ‘C’
- PF =30 % of basic
Note :-
- Change the data according to the question.
- Choose any data if no details are given.
{\\Java
class Employee
{
public string name;
public int salary;
public int joiningDate;
public Employee()
{
}
public Employee(Karam, 40000, 11-04-2001)
{
this.name = karam;
this.salary =40000 ;
this.joiningDate =11-04-2001 ;
}
public void GetEmployeeData()
{
{
public void DisplayEmployee()
{
("The name of employee is: "+ Shiv);
Console.WriteLine("The salary of employee is: "+30000);
Console.WriteLine("The date of joining of employee is: "+16-06-2003);
}
}
public Employee(Shiv, 30000,16-06-2003 )
class Program
{
static void Main(string[] args)
{
Employee[] e = new Employee[10];
for(int i = 0; i < 10; i++)
for(int i = 0; i < 10; i++)
{
e].DisplayEmployee();
}
}
}