Thursday, 11 May 2017

Java Program for Find The Salary of an Employee With Employee Grade

Problem:- Java Program For Find The Salary Of An Employee With Employee Grade (Performance). or Java Program For Find The Salary Of An Employee With Employee Grade or simple employee program in java or employee details program in java or employee salary calculation program in java or employee details program in java using inheritance or java program for employee details using array or java program for employee payroll or employee salary calculation program in java,

Note:- Please See This is A Requested Problem From Pakistan. See You Can Also Request Any Problem Regarding Programming. So Don't Forgot To Share Thanks, Learning Point (Chowk Azam, Pakistan) Writing For Us.

"write a code in java that input salary and grade of an employee and apply below conditions:

i) in case of grade 15 or above than bonus is 15%
ii) in case of grade 16 or above than bonus is 20%
iii) in case of grade 18 or above than bonus is 25%
iv) after calculating total salary deduct 13% GST in case that salary is 15000 or above. deduct 15% GST and in case that salary is 22000 or above.
v) Add 6% bonus at the end

Calculate net salary according to above condition and display it."




Logic:- So according to first three conditions in the problem I use if-else Statement For a grade of employee see below.

if(grade==15)
{
 bonus=(basic_salary*15)/100;
} 
else if(grade==16 || grade==17 )
{
 bonus=(basic_salary*20)/100;
}
else if(grade>=18)
{
 bonus=(basic_salary*25)/100;
}

After That, We Get a Basic Salary + Bonus. Now According to GST ( Goods and Service Tax ) Conditions Calculate a remaining Salary After All Calculation 6% Bonus.

if(basic_salary>=15000 && basic_salary<22000 basic_salary-="gst;" basic_salary="" bonus1="" else="" gst="(basic_salary*13)/100;" if="">=22000)
{
 gst=(basic_salary*15)/100;
 
 basic_salary-=gst;
 
 bonus1=(basic_salary*6)/100;

 basic_salary+=bonus1;

}
else
{
 bonus1=(basic_salary*6)/100;

 basic_salary+=bonus1;
}
At the end print the Salary.

Example:- Lets Assume Employee Salary is 20,000 And Grade is 15 Then Calculate an Employee Salary.

20,000 Salary and 15 Grade Bonus is 15% then Bonus = 3000.

Now Total Salary is 20,000+3000=23,000

Now Salary is Greater than 22,000 Then 15% GST, So GST = 3450.

Now Total Salary is 23,000 - 3450 = 19550.

At the End 6% Bonus Then Bonus = 1173

So Gross Salary Of Employee is =19500+1173=20723.

Gross Salary = 20723 .

Try This Java Program For Find The Gross Salary Of An Employee


Solution:- Java Program for Find The Salary of an Employee With Employee Grade


import java.util.Scanner;
import java.lang.*;

/* Program By Ghanendra Yadav
   Visit http://www.programmingwithbasics.com
*/

class employeesalary
{
public static void main(String args[]) 
{
 float basic_salary,bonus1=0,bonus=0,gst;
 int grade;
 
 Scanner scan=new Scanner(System.in);

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

 System.out.println("\nEnter The Grade Of Employee : ");    
 grade=scan.nextInt();
 
if(grade==15)
{
 bonus=(basic_salary*15)/100;
} 
else if(grade==16 || grade==17 )
{
 bonus=(basic_salary*20)/100;
}
else if(grade>=18)
{
 bonus=(basic_salary*25)/100;
}
 
 basic_salary+=bonus;
 
if(basic_salary>=15000 && basic_salary<22000 basic_salary-="gst;" basic_salary="" bonus1="" else="" gst="(basic_salary*13)/100;" if="">=22000)
{
 gst=(basic_salary*15)/100;
 
 basic_salary-=gst;

 bonus1=(basic_salary*6)/100;

 basic_salary+=bonus1;
}
else
{
 bonus1=(basic_salary*6)/100;

 basic_salary+=bonus1;
} 
    System.out.println("\nGross Salary Of Employee : "+basic_salary);
}
} 

Output:-

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date. If you have any Query or Question you can ask in the group, I will Try To Solve your Query and try to answers of your Questions withing 24 Hours, You can also Email me or comment below Please suggest to your Friends to join and like our page and don't forget to Subscribe. Enter your Email and click to subscribe.

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

2 comments: