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).

Gross Salary Program in Java

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

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); } }

The Output Gross of Salary Program in Java

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me