-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhospital management.cpp
42 lines (33 loc) · 1 KB
/
hospital management.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
#include <iostream>
#include <string>
using namespace std;
class Patient {
private:
string name;
int age;
string gender;
string condition;
public:
Patient(const string& name, int age, const string& gender, const string& condition)
: name(name), age(age), gender(gender), condition(condition) {}
void displayInfo() const {
cout << "Name: " << name << endl;
cout << "Age: " << age << endl;
cout << "Gender: " << gender << endl;
cout << "Condition: " << condition << endl;
}
};
int main() {
// Create patients
Patient patient1("John Doe", 35, "Male", "Fever");
Patient patient2("Jane Smith", 45, "Female", "Broken leg");
// Display information of patient1
cout << "Patient 1 Information:" << endl;
patient1.displayInfo();
cout << endl;
// Display information of patient2
cout << "Patient 2 Information:" << endl;
patient2.displayInfo();
cout << endl;
return 0;
}