-
Notifications
You must be signed in to change notification settings - Fork 0
/
Basic.java
197 lines (87 loc) · 4.31 KB
/
Basic.java
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
package java;
import java.util.Scanner;
class Patient_node{
String name,address,disease;
int age,room_no,ID;
long contact_no;
String date;
Patient_node(String name){
this.name=name;
}
}
class Staff_node{
String name,address,department;
int contact_no,ID,Experience;
Staff_node(){
}
}
class doctor_node{
String name,address;
String specialisation,qualification;
int contact_no,ID,Experience;
doctor_node next_doc;
Scanner sc=new Scanner(System.in);
doctor_node(int ID,String name){
this.ID=ID;
this.name=name;
this.address=address;
this.contact_no=contact_no;
this.Experience=Experience;
this.specialisation=specialisation;
this.qualification=qualification;
}
void add_Doc_info() {
System.out.println("Enter Doctor Information here");
System.out.println("Enter doctor's assigned ID");
ID=sc.nextInt();
System.out.println("Enter doctor's name");
name=sc.nextLine();
System.out.println("Enter doctor's specialisation");
specialisation=sc.nextLine();
System.out.println("Enter doctor's qualification");
qualification=sc.nextLine();
System.out.println("Enter doctor's contact number");
contact_no=sc.nextInt();
System.out.println("Enter doctor's address");
address=sc.nextLine();
}
void display_Doc_info() {
System.out.println("Doctor Information");
System.out.println("Doctor ID: "+ID);
System.out.println("Doctor name "+name);
System.out.println("Doctor specialisation: "+specialisation);
System.out.println("Doctor qualification "+qualification);
System.out.println("Doctor contact number: "+contact_no);
System.out.println("Doctor address "+address);
}
}
class Hospital_Management{
doctor_node head_doc;
Scanner sc=new Scanner(System.in);
doctor_node temp=new doctor_node(0, null);
void Add_doctor() {
int op=0;
do {
temp.add_Doc_info();
if(head_doc==null)
head_doc=temp;
else
{ doctor_node ptr=head_doc;
while(ptr.next_doc!=null)
{
ptr=ptr.next_doc;
}
ptr.next_doc=temp;
}
System.out.println("Enter 1 to continue adding doctor details else enter 0");
op=sc.nextInt();
}while(op==1);
}
Hospital_Management(){
head_doc=null;
}
}
public class mini {
public static void main(String args[]) {
}
}