Create a class SalaryCalculation that is describe as below: Class Name : SalaryCalculation Data members : name(String type data) basicPay, specialAlw, conveyanceAlw, gross, pf, netSalary, AnnualSal (all double type data) Member methods: SalaryCalculation() - A constructor to assign name of employee (name), basic salary (basicPay) of your choice and conveyance allowance (conveyanceAlw) as Rs. 1000.00 void SalaryCal() - to calculate other allowance and salaries as given: specialAlw = 25% of basic salary. netSalary = gross – pf AnnualSal = 12 months netSalary. void display() - to print the name and other calculations with suitable headings. Write a program in java to calculate all the details mentioned above and print them all.
Answers
Answered by
0
Answer:
34%,26%,36% is the best answer
Answered by
8
Answer:
class SalaryCalculation
{
String name;
double basicPay,specialAlw,conveyanceAlw,gross,pf,netSalary,AnnualSal;
SalaryCalculation ()
{
name="Radhe";
basicPay=3000.00;
conveyanceAlw=1000.00;
{
void SalaryCal()
{
specialAlw=25/100*basicPay;
gross=basicPay+specialAlw+conveyanceAlw;
netSalary=gross-pf;
AnnualSal= 12*netSalary;
}
void display()
{
System.out.println("Name of employee="+name);
System.out.println("net salary="+netSalary);
System.out.println("Annual salary="+AnnuapSal);
//also print gross and specialAlw
}
SalaryCalculation obj= new SalaryCalculation ();
obj.SalaryCal();
obj.display();
}
}
Hope it helps :)
ps.also initialise pf *
Similar questions
Accountancy,
4 months ago
Art,
4 months ago
History,
4 months ago
Math,
9 months ago
Political Science,
9 months ago
Math,
1 year ago