-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstaffinfo.java
More file actions
94 lines (85 loc) · 1.58 KB
/
staffinfo.java
File metadata and controls
94 lines (85 loc) · 1.58 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import java.util.Scanner;
class staff
{
String name;
int staffid;
double salary;
long phone;
void getdata()
{
Scanner input=new Scanner(System.in);
System.out.println("Enter the name,staffid,salary,phone\n");
name=input.nextLine();
staffid=input.nextInt();
salary=input.nextDouble();
phone=input.nextLong();
}
void display()
{
System.out.println("\nName:"+name+"\nStaffid:"+staffid+"\nSalary:"+salary+"\nPhone no:"+phone);
}
}
class teaching extends staff
{
String domain;
int no_pub;
void input_teach()
{
super.getdata();
Scanner z=new Scanner(System.in);
System.out.println("Enter the domain and no of publications");
domain=z.nextLine();
no_pub=z.nextInt();
}
void disp_teach()
{
super.display();
System.out.println("Domain:"+domain+"no_pub:"+no_pub);
}
}
class techinical extends staff
{
String skill;
void input_tech()
{
super.getdata();
Scanner z=new Scanner(System.in);
System.out.println("Enter the skill\n");
skill=z.nextLine();
}
void disp_tech(){
super.display();
System.out.println("Skill:"+skill);
}
}
class contr extends staff
{
int period;
void input_cont()
{
super.getdata();
Scanner z=new Scanner(System.in);
System.out.println("Enter the periods\n");
period=z.nextInt();
}
void display_cont()
{
super.display();
System.out.println("Period:"+period);
}
}
class staffinfo
{
public static void main(String[]args)
{
teaching a=new teaching();
a.input_teach();
a.disp_teach();
techinical b=new techinical();
b.input_tech();
b.disp_tech();
contr c=new contr();
c.input_cont();
c.display_cont();
}
}