Oop Microproject
Oop Microproject
SYCM-2
C-batch
|
• COURSE :- COMPUTER TECHNOLOGY
2
INDEX :-
PROGRAM 3-6
WORKING 7-9
OUTPUT 10 - 12
CONCLUSION 13
3
PROGRAM OF HOSPITAL MANAGEMENT
SYSTEM
#include <iostream>
#include "hospital.h"
using namespace std;
class patient
{
public:
int pid;
char pname[20];
char paddress[20];
char pgender[10];
char diseases[20];
char symptoms[20];
void getdatap()
{
cout << "\nEnter patient ID :";
cin >> pid;
cout << "Enter patient name :";
cin >> pname;
cout << "Enter patient address :";
cin >> paddress;
cout << "Enter patient gender :";
cin >> pgender;
cout << "Enter patient disease :";
cin >> diseases;
cout << "Enter patient symptoms :";
cin >> symptoms;
}
void sid(const patient patients[], int numPatients, int searchID)
{
bool found = false;
for (int i = 0; i < numPatients; i++)
{
if (patients[i].pid == searchID)
{
found = true;
cout << "\nPatient Information (ID: " << searchID << "):\
n";
cout << "Patient Name: " << patients[i].pname << endl;
cout << "Patient Address: " << patients[i].paddress <<
endl;
cout << "Patient Gender: " << patients[i].pgender << endl;
4
cout << "Patient Disease: " << patients[i].diseases <<
endl;
cout << "Patient Symptoms: " << patients[i].symptoms <<
endl;
break;
}
}
if (!found)
{
cout << "Patient with ID " << searchID << " not found." << endl;
}
}
class doctor
{
int did;
char dname[20];
char daddress[20];
char dgender[10];
char qualification[20];
public:
void getdatad()
{
cout << "\nEnter docID :";
cin >> did;
cout << "Enter name :";
cin >> dname;
cout << "Enter address :";
cin >> daddress;
cout << "Enter gender :";
cin >> dgender;
cout << "Enter qualification :";
cin >> qualification;
}
5
if (numPatients == 0)
{
cout << "No patients in the system." << endl;
}
else
{
for (int i = 0; i < numPatients; i++)
{
int main()
{
const int maxPatients = 100; // Maximum number of patients
patient patients[maxPatients]; // Array to store patient information
doctor d;
int numPatients = 0;
int choice;
while (choice!=6)
{
cout<<"___________________________________________________________________
__________________________________________________________________________
_______________";
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t HOSPITAL
MANAGEMENT SYSTEM \n\n";
cout << "\n\n\t\t\t\t\t\tPlease, Choose from the following
Options: \n\n";
cout << "\t\t\t\t\t\t
_________________________________________________________________\n";
cout << "\t\t\t\t\t\t|
|\n";
cout << "\t\t\t\t\t\t| 1 >> Add New Patient Record
|\n";
cout << "\t\t\t\t\t\t| 2 >> Add Doctor Information
|\n";
cout << "\t\t\t\t\t\t| 3 >> Full History of the
Patients |\n";
cout << "\t\t\t\t\t\t| 4 >> Information About the
Hospital |\n";
cout << "\t\t\t\t\t\t| 5 >> Search Patient ID
|\n";
cout << "\t\t\t\t\t\t| 6 >> Exit the Program
|\n";
cout << "\t\t\t\t\t\t|
_________________________________________________________________|\n\n";
cout << "\t\t\t\t\t\tEnter your choice: ";
6
cin >> choice;
switch (choice)
{
case 1:
if (numPatients < maxPatients)
{
patients[numPatients].getdatap();
numPatients++;
}
else
{
}
break;
case 2:
d.getdatad();
break;
case 3:
displayPatientInfo(d, patients, numPatients);
break;
case 4:
displayHospitalInfo();
break;
case 5:
int searchID;
cout << "\nEnter the patient ID to search: ";
cin >> searchID;
patient p;
p.sid(patients, numPatients, searchID);
break;
case 6:
cout << "\nThank you for using the ISNP Hospital Management
System!\n";
cout << "We hope our services have been helpful to you.\n";
return 0;
default:
cout << "\nEnter valid choice!";
}
}
return 0;
}
7
WORKING OF PROGRAM :-
In the main loop, the program displays a menu of options for the
user to choose from.
8
CLASS PATIENT
9
CLASS DOCTOR
displayPatientInfo() function:
10
OUTPUT OF THE PROGRAM :-
11
12
13
CONCLUSION
*****
14
THANK
YOU
15