Write a code in java that input salary and grade of an employee and apply conditions
- in case of grade 15 or above than bonus is 15%
- in case of grade 16 or above than bonus is 20%
- in case of grade 18 or above than bonus is 25%
- 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.
- 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.
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
At the end print the Salary.
Example:- let's assume employee salary is 20,000 and grade are 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 an employee is =19500+1173=20723.
Gross salary = 20723.
Output:
Enter Basic Salary Of Employee :
20000
Enter The Grade Of Employee :
15
Gross salary of employee : 20723.0
need an explanation for this answer? contact us directly to get an explanation for this answer