Question: 3. Write a Java program to calculate salary of an employee in the company. Member variables are: Employee_No, Employee_name, Basic salary, Dearness Allowance (DA), House

 3. Write a Java program to calculate salary of an employee

3. Write a Java program to calculate salary of an employee in the company. Member variables are: Employee_No, Employee_name, Basic salary, Dearness Allowance (DA), House Rent allowance (HRA), and Gross_salary. Member Methods are: To calculate and return Dearness Allowance (DA) - (DA - 30% of basic salary), To calculate and return House Rent Allowance (HRA) (35% of basic salary in case the basic salary is > 400, otherwise it is 30% of basic salary), ------ If else cond To calculate and return Gross_salary (Basic + DA + HRA), Hint: 2 classes: (i)class emp: data members, methods (ii)controlling class(public)+obj ->employee

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!