-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjavaintface.java
More file actions
48 lines (42 loc) · 1.29 KB
/
javaintface.java
File metadata and controls
48 lines (42 loc) · 1.29 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
import java.io.BufferedReader;
import java.io.InputStreamReader;
class Emp{
int Reg_no, Rt1, Rt2, Rt3 ;
String name;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
void GetInput() throws Exception{
System.out.println("PLz Enter Employee Detalils");
Reg_no = Integer.parseInt(br.readLine());
name = br.readLine();
Rt1 = Integer.parseInt(br.readLine());
Rt2 = Integer.parseInt(br.readLine());
Rt3 = Integer.parseInt(br.readLine());
}
void Display(){
System.out.println("Reg_no :"+Reg_no);
System.out.println("name :"+name);
System.out.println("Rt1 :"+Rt1);
System.out.println("Rt2 :"+Rt2);
System.out.println("Rt3 :"+Rt3);
}
}
class Output extends Emp{
int avg ;
float percentage;
void evaluate() throws Exception{
GetInput();
avg = Rt1 + Rt2 + Rt3;
percentage = (float)avg/3;
}
void screenShow(){
System.out.println("avg:"+avg);
System.out.println("percentage :"+percentage);
}
}
public class javaintface{
public static void main(String[] args) throws Exception {
Output foo = new Output();
foo.evaluate();
foo.screenShow();
}
}