-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanager.java
More file actions
40 lines (40 loc) · 949 Bytes
/
manager.java
File metadata and controls
40 lines (40 loc) · 949 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
37
38
39
40
import java.util.Scanner;
class Employee
{
int emp_no;
String emp_name="";
int basic_sal;
}
class officer extends Employee
{
double travelallowance;
}
class manager extends officer
{
Scanner in=new Scanner(System.in);
int educationallowance=5000;
public void get()
{
System.out.println("Enter the emp_name");
emp_name=in.nextLine();
System.out.println("Enter the emp_no");
emp_no=in.nextInt();
System.out.println("Enter the basic salary");
basic_sal=in.nextInt();
travelallowance=(basic_sal*0.10);
}
public void print()
{
System.out.println("Employee id:" +emp_no);
System.out.println("Employee name:" +emp_name);
System.out.println("Employee basic salary:" +basic_sal);
System.out.println("Employee travel allowance:" +travelallowance);
System.out.println("Employee education allowance:" +educationallowance);
}
public static void main(String arg[])
{
manager x1=new manager();
x1.get();
x1.print();
}
}