-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpecialNeedsStudent.java
More file actions
51 lines (44 loc) · 1.19 KB
/
SpecialNeedsStudent.java
File metadata and controls
51 lines (44 loc) · 1.19 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
package spec;
public class SpecialNeedsStudent extends Student {
private boolean needsWC, isVI;
public SpecialNeedsStudent() {
super();
this.needsWC = this.isVI = false;
}
public SpecialNeedsStudent(String rollNumber, String name, boolean needsWC, boolean isVI) {
super(rollNumber,name);
this.needsWC = needsWC;
this.isVI = isVI;
}
public SpecialNeedsStudent(String rollNumber) {
super(rollNumber);
this.needsWC = false;
this.isVI = false;
}
public void displayData() {
super.displayData();
System.out.println("---Special Needs---");
if(this.isVI) {
System.out.println("Student is Visually Impaired.");
}
if(this.needsWC) {
System.out.println("Student requires a wheelchair.");
}
}
public void displayData(String rno) {
super.displayData(rno);
System.out.println("---Special Needs---");
if(this.isVI) {
System.out.println("Student is Visually Impaired.");
}
else {
System.out.println("Student is not Visually Impaired.");
}
if(this.needsWC) {
System.out.println("Student requires a wheelchair.");
}
else {
System.out.println("Student doesn't require a wheelchair.");
}
}
}