WAP Java to accept basic salary of an employee and talcurore
the net salary according to following formula -
Gross Salary = basic salary + DA + HRA
Deduction - PF+IT
Net sarany = gross salary - deduction
DA = 40% Of basic salary
HRA = 30% of basic salary
PF- 12% of basic salary
income tan : 2% of basic salary
use meaningful variables.
Answers
Answered by
8
Answer:
//Program to calculate Net Salary
import java.util.*;
public class Salary
{
public static void main (String ar [])
{
Scanner sc=new Scanner (System.in);
System.out.println("Enter Basic Salary");
double BS=sc.nextDouble();
double NS,DA,HRA,PF,IT,GS,D;
DA= (40/100)* BS;
HRA=(30/100)* BS;
PF=(12/100)* BS;
IT=( 2/100)*BS; //Income tax
D=PF+IT; //Deduction
GS=BS+DA+HRA; //Gross Salary
NS=GS-D; //Net Salary
System.out.println("Net Salary="+NS);
}
}
Variable Description:-
- DA:- To calculate DA
- HRA:- To calculate HRA
- PF:- To calculate PF
- NS:- To calculate Net Salary
- D:- To calculate Deduction
- GS:- to calculate Gross Salary
- IT:- To calculate Income tax
- BS:- To Accept basic salary as input
anindyaadhikari13:
Goodm
Similar questions