-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrossSalary.java
More file actions
36 lines (33 loc) · 800 Bytes
/
GrossSalary.java
File metadata and controls
36 lines (33 loc) · 800 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
29
30
31
32
33
34
35
36
package practice;
import java.util.Scanner;
import javax.xml.crypto.Data;
class salary{
double basic,TA ,DA,HRA;
salary(double basic,double TA,double DA,double HRA ) {
this.TA =TA;
this.DA =DA;
this.HRA =HRA;
}
void getSalary()
{
System.out.println("Enter the Salary \nBasic \nTA \nDA \nHRA");
Scanner scanner=new Scanner(System.in);
basic=scanner.nextDouble();
TA=scanner.nextDouble();
DA=scanner.nextDouble();
HRA=scanner.nextDouble();
}
void calSalary(){
DA=basic*0.8;
HRA=basic*1.5;
float gross=(float) (basic+TA+DA+HRA);
System.out.println("Gross Salray = " +gross );
}
}
public class GrossSalary{
public static void main(String[] args) {
salary emp =new salary(0,0, 0, 0);
emp.getSalary();
emp.calSalary();
}
}