Write a Program to Calculate Gross Salary of an Employee in Java

Gross Salary Program in Java or write a program to calculate the gross salary of an employee in java or Java Program to Calculate Salary of an Employee or Write A C Program For Find The Gross Salary Of An Employee. Gross salary is different from Net, Salary gross salary calculated annual basis we can calculate a gross salary by using the following formula (Gross salary = Net Salary - Deduction).

Salary Deduction = Tax ( Provident Fund - Professional Tax - Income Tax).

Gross Salary Formula in Java

Gross Salary = Basic Salary + HRA + Other Allowances

Deduction = Gross Salary - PF - PT - IT.

Net Salary = Gross Salary - Deduction.

See Also C++ Program For Find The Gross Salary of an Employee

To find the gross salary of the Employee we need to calculate DA and HRA Then the Sum of Basic Salary + HRA + DA. after calculating the sum print the sum. So basically first we calculate a DA, and HRA after that we add Basic Salary + HRA +DA so, in this way, we can find the Gross salary of an employee.

Gross Salary Program in Java

``````import java.util.Scanner;
/* gross salary program in java */
class employeesalary {

public static void main(String args[]) {
float basic_salary, da, hra, da1, hra1, GrossSalary;

Scanner scan = new Scanner(System.in);

System.out.println("Enter Basic Salary Of Employee: ");
basic_salary = scan.nextFloat();

System.out.println("Enter Basic DA Of Employee: ");
da1 = scan.nextFloat();

System.out.println("Enter Basic HRA Of Employee: ");
hra1 = scan.nextFloat();

da = (da1 * basic_salary) / 100;
hra = (hra1 * basic_salary) / 100;

GrossSalary = basic_salary + da + hra;

System.out.println("Gross Salary Of Employee: " + GrossSalary);
}
}``````

Previous Post
Next Post