Repository navigation
Expand file tree
/
Copy pathPatient.java
More file actions
59 lines (48 loc) · 1.45 KB
/
Copy pathPatient.java
File metadata and controls
59 lines (48 loc) · 1.45 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
public class Patient {
private String id_no;
private String full_name;
private int age;
String address;
// constructor to insantiate the object
public Patient(String id, String name, String address, int age) {
this.id_no = id;
this.full_name = name;
this.address = address;
this.age = age;
}
// define getters & setters
public String getIdNo() {
// retrives the value of the private variable id_no
return this.id_no;
}
public void setIdNo(String id) {
// sets the value of the private variable id_no
this.id_no = id;
}
public String getFullName() {
// retrives the value of the private variable full_name
return this.full_name;
}
public void setFullaName(String name) {
// sets the value of the private variable full_name
this.full_name = name;
}
public int getAge() {
// retrives the value of the private variable age
return this.age;
}
public void setAge(int age) {
// sets the value of the private variable age
this.age = age;
}
public void admit() {
System.out.println("Patient has been admitted");
}
public void getInformation() {
System.out.print("ID NO: " + id_no);
System.out.print("NAME: " + full_name);
}
public void addMedicalReport() {
System.out.println("A new medical report has been added.");
}
}