Computer Science, asked by srivastavabhay607, 4 months ago

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 BrainlyProgrammer
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:-

  1. DA:- To calculate DA
  2. HRA:- To calculate HRA
  3. PF:- To calculate PF
  4. NS:- To calculate Net Salary
  5. D:- To calculate Deduction
  6. GS:- to calculate Gross Salary
  7. IT:- To calculate Income tax
  8. BS:- To Accept basic salary as input

anindyaadhikari13: Goodm
anindyaadhikari13: Good.*
BrainlyProgrammer: thanks
Similar questions