-
Notifications
You must be signed in to change notification settings - Fork 0
/
HospitalManagement.cpp
54 lines (45 loc) · 1.3 KB
/
HospitalManagement.cpp
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
#include <iostream>
#include <string>
using namespace std;
// Class for managing hospital records
class Patient {
private:
string name;
int age;
string disease;
string doctor;
public:
// Default Constructor
Patient() {
name = "Unknown";
age = 0;
disease = "None";
doctor = "Unassigned";
}
// Destructor
~Patient() {
cout << "Record of " << name << " is deleted." << endl;
}
// Function to admit a patient
void admitPatient(string pName, int pAge, string pDisease, string pDoctor) {
name = pName;
age = pAge;
disease = pDisease;
doctor = pDoctor;
}
// Function to display patient details
void displayPatientInfo() {
cout << "Patient Name: " << name << endl;
cout << "Age: " << age << endl;
cout << "Disease: " << disease << endl;
cout << "Doctor Assigned: " << doctor << endl;
}
};
int main() {
Patient p1;
// Admitting a patient
p1.admitPatient("John Doe", 35, "Flu", "Dr. Smith");
// Display patient information
p1.displayPatientInfo();
return 0;
}