-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNetsalary.java
More file actions
28 lines (27 loc) · 787 Bytes
/
Netsalary.java
File metadata and controls
28 lines (27 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner;
class Netsalary
{
public static void main(String arg[])
{
double gs,it,pt,pf,netSalary;
Scanner sc=new Scanner(System.in);
System.out.println("Enter Gross salary");
gs=sc.nextDouble();
System.out.println("Enter Income Tax %");
it=sc.nextDouble();
System.out.println("Enter Professional Tax %");
pt=sc.nextDouble();
System.out.println("enter Provident Fund %");
pf=sc.nextDouble();
netSalary=salary(gs,pf,pt,it);
System.out.println("Net Salary is="+netSalary);
}
static double salary(double gs,double pf,double pt,double it)
{
pf=pf*(gs/100);
it=it*(gs/100);
pt=pt*(gs/100);
double n=gs-it-pt-pf;
return n;
}
}