//Calculate gross salary and net salary
import java.util.Scanner;
public class Salary {
public static void main(String args[])
{
long bs;
int pf=200;
float gs,hra,ta,da,net;
Scanner sc=new Scanner(System.in);
System.out.println("Enter basic salary:");
bs=sc.nextLong();
hra=(0.2f)*bs;
ta=(0.15f)*bs;
da=(0.1f)*bs;
gs=bs+da+hra+ta;
net=gs-pf;
System.out.println("Basic Salary:"+bs);
System.out.println("HRA:"+hra);
System.out.println("DA:"+da);
System.out.println("TA:"+ta);
System.out.println("PF:"+pf);
System.out.println("Gross Salary:"+gs);
System.out.println("Net Salary:"+net);
}
}
import java.util.Scanner;
public class Salary {
public static void main(String args[])
{
long bs;
int pf=200;
float gs,hra,ta,da,net;
Scanner sc=new Scanner(System.in);
System.out.println("Enter basic salary:");
bs=sc.nextLong();
hra=(0.2f)*bs;
ta=(0.15f)*bs;
da=(0.1f)*bs;
gs=bs+da+hra+ta;
net=gs-pf;
System.out.println("HRA:"+hra);
System.out.println("DA:"+da);
System.out.println("TA:"+ta);
System.out.println("PF:"+pf);
System.out.println("Gross Salary:"+gs);
System.out.println("Net Salary:"+net);
}
}
No comments:
Post a Comment