Академический Документы
Профессиональный Документы
Культура Документы
TABLE OF CONTENTS
PROJECT DETAIL:................................................................................................................3
DATA STRUCTURE USED:.............................................................................................3
MAIN FUNCTIONS:..........................................................................................................3
MAIN FEATURES:........................................................................................................3
PROGRAM:.............................................................................................................................4
OUTPUT:...............................................................................................................................25
ENTERING DATE:.......................................................................................................25
ENTERING PATIENTS DATA:..................................................................................26
ERROR CHECKING:...................................................................................................27
VIEW OF PATIENTS IN DATABASE:......................................................................27
DETAIL OF PATIENT:................................................................................................28
MOVING BACK TO MAIN MENUE:........................................................................28
SEARCHING A PATIENT FROM DATABASE:......................................................29
SEARCHING BY CITY:..............................................................................................29
DETAILED VIEW OF SEARCHED PATIENT:........................................................30
SEARCH BY BLOOD GROUP:..................................................................................31
DELETING AN ENTERY:...........................................................................................33
RECYCLE BIN:............................................................................................................33
RESTORING ENTERIES:............................................................................................34
ABOUT SOFTWARE:..................................................................................................35
EXIT:.............................................................................................................................36
PROJECT DETAIL:
DATA STRUCTURE USED:
Arrays
Structures
MAIN FUNCTIONS:
MAIN FEATURES:
Recurssion
Switch statement
Jump statement
Continue,break,exit
If-else statement
loops
PROGRAM:
/*
**************************************************
* Project:
*
* Simulation of hospital Management Software *
**************************************************
*/
#include<iostream.h> //for input and output stream regulation
#include<process.h> //for exit()
#include<string.h> //for strlen() and strcmp()
#include<conio.h>
//for getch() and clrscr()
#include<graphics.h> //for changing background and text color
class all
//declaration for class "all"
{ private:
struct address
{ int house;
char city[30]; char dist[30];
char state[30]; char street[30];
char country[30]; };
struct age
{ int day; int month;
int year; };
struct patient_info
{ age A1;
//nested structure inplemented
address AD1;
//nested structure implemented
int sex; int reg_no; int bld_group;
char name[50];
int martial_status;
}PI[100];
int task;
protected:
//functions declared
void search_menu();
void search_city();
void exit_function();
void search_show_info();
void search_blood_group();
void enter_patient_info();
void show_patient_detail();
void after_search_options();
void after_restore();
public:
void tasks();
void recycle_bin();
void delete_entry();
void software_detail();
void after_delete_options();
int s_group;
int s_choice;
int en_del_index;
int delete_choice;
char ch;
char answer;
5
char answer1;
char s_city[30];
char exit_answer;
char delete_confirm;
char after_search_answer;};
//end of class "all"
class date
//declaration for class "date"
{ private:
int date;
int month;
int year;
public:
void enter_date();
void show_date();};
//end of class "date"
class dob
//declaration for class "dob"
{ private:
struct dob1
{ int date;int month;int year;int rem;
}DOB11[100];
public:
char birth_answer;
void show_date();
void enter_date();
void search_show_date();};
//end of class "dob"
//temporary variables declared with global scope
int m, i=0,j=0,k,d=0,e=0,f=0, rem,temp,count=0,regis, index,entry,serial=0;
int attempt, current,d_index=0,ssi_count=0, show_count=0, delete_show=0;
int search_index, delete_attempt=0, restore_attempt=0;
int search_count,current_year, delete_count=0, search_number, restore_serial;
int entry_index[100], after_search_choice, after_restore_choice;
char enter_now, restore_confirm, duplicate_answer, delete_all_confirm, restore_all_confirm, after_search_answer;
all A1;
//object for class "all" declared
date D1;
//object for class "date" declared
dob DOB1;
//object for class "dob" declared
void all::tasks()
{ clrscr();
textbackground(3);
textcolor(1);
D1.show_date();
cout<<"\n\n\t\t\t***HOSPITAL MANAGEMENT SOFTWARE***"<<"\n";
cout<<"\t\t\t
By Madiha and Marwa "<<"\n";
cout<<"\n\t\t\t ***Hospital Management Tasks***"<<"\n";
cout<<"\t\t\t *******************************"<<"\n";
cout<<"\n\n\tPlease select a task to do...."<<"\n";
cout<<"\n\n\t1. Enter a new patient information "<<"\n";
cout<<"\t2. View detail of existing patient "<<"\n";
cout<<"\t3. Search by city or blood group"<<"\n";
cout<<"\t4. Delete entry "<<"\n";
cout<<"\t5. Recycle Bin "<<"\n";
cout<<"\t6. About "<<"\n";
cout<<"\t7. Exit "<<"\n\n\n";
cout<<"\a Enter your task serial : ";
cin>>task;
switch(task)
{ case 1:{
A1.enter_patient_info(); break; }
case 2:
{ A1.show_patient_detail(); break; }
case 3:{
A1.search_menu();break;}
case 4:{
6
A1.delete_entry();break;}
case 5:{
A1.recycle_bin(); break;}
case 6:{
A1.software_detail(); break;}
case 7:{
A1.exit_function(); break;}
default:{clrscr();
cout<<"\n\n\n\n\n\tInvalid task serial !!!"<<"\n";
cout<<"\tValid options are 1-6 !!!"<<"\n";
cout<<"\tPress any key to return to the main task menu....\a"<<"\n";
getch();
clrscr();
A1.tasks(); } }
//end of switch for task
}
//end of function
void date::enter_date()
{ cout<<"\n\nFirst of all I need the current date ..."<<"\n";
cout<<"\nYear : ";
cin>>year;
while(year<2012||year>10000)
{cout<<"\aInvalid input for year !!!"<<"\n";
cout<<"Please enter the year correctly : "<<"\n";
cin>>year; }
current_year=year;
cout<<"Month : ";
cin>>month;
while(month<=0||month>12) //if month is greater then 12 or less then 1
{ cout<<"\nInvalid input for month !!!"<<"\n";
cout<<"Please enter the month correctly : \a"<<"\n";
cin>>month;}
cout<<"Date : ";
switch(month)
{ case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:{
cin>>date;
while(date<1||date>31) //for months with 31 days
{ cout<<"\aInvalid date !!!"<<"\n";
cout<<"Again enter the date : "<<"\n";
cin>>date; }
break;}
case 2:{
cin>>date;
//for february
if(year%4==0)
{ while(date<0||date>29) //for leap year
{ cout<<"\aInvalid date !!!"<<"\n";
cout<<"Again enter the date : "<<"\n";
cin>>date;}}
else
{ while(date<0||date>28) //for non-leap year
{ cout<<"\aInvalid date !!!"<<"\n";
cout<<"Again enter the date : "<<"\n";
cin>>date;}}
break;}
default:{
//for other months with 30 days
cin>>date;
while(date<1||date>30)
{ cout<<"\aInvalid date !!!"<<"\n";
7
cout<<"Again enter the date : "<<"\n";
clreol();
cin>>date;}
break; } }
//end of switch
}
//end of function
void date::show_date()
{clrscr();
cout<<"Hello....\n It's ";
cout<<date;
rem=date%10;
switch(date)
{case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:{
cout<<"th ";
goto over; } }
switch(rem)
{ case 1:{
cout<<"st "; break; }
case 2:{cout<<"nd "; break; }
case 3:{cout<<"rd ";break;}
default:{
cout<<"th ";break; }
}
//end of switch
over:
//label for jump statement
switch(month)
{ case 1:{
cout<<"January , "; break; }
case 2:{ cout<<"February , ";break;}
case 3:{cout<<"March , ";break;}
case 4:{ cout<<"April , ";
break; }
case 5:{ cout<<"May , ";
break; }
case 6:{
cout<<"June , "; break; }
case 7:{
cout<<"July , "; break;}
case 8:{
cout<<"August , "; break; }
case 9:{
cout<<"September , "; break; }
case 10:{
cout<<"October , "; break;}
case 11:{
cout<<"November , "; break; }
case 12:{ cout<<"December , ";
break; }
}
//end of switch
cout<<year<<" \n";}//end of function
void all::enter_patient_info()
{ clrscr();
if(current==100)
//to avoid overflow of data in the database
8
{ cout<<"\n\n\n\t Database is full !!! ";
cout<<"\n\t Sorry, you cannot enter any more information !!! ";
cout<<"\n\t Information of maximum 100 patients can be entered !!!! ";
cout<<"\n\t Press any key to return to the main menu....\a ";
getch();
A1.tasks(); }
answer='y';
if(count==0)
{ serial=1; }
else
{ i=serial; }
for(i=serial;answer=='y'||answer=='Y';i++)
{ cout<<"\a";
current++;
PI[i].reg_no=i;
temp=serial;
clrscr();
entry_index[i]=1;
cout<<"\n\n\t ***ENTERING INFORMATION FOR PATIENT SERIAL NUMBER "<<i<<" ***"<<"\n";
cin.get(ch);
cout<<"\nRegistration Number : "<<PI[i].reg_no<<"\n\n";
cout<<"Enter the name of patient : "; //
cin.getline(PI[i].name,50);
while(strlen(PI[i].name)==0)
{ cout<<"\a\nPlease enter a name : "; //if enter is pressed before netering a name
cin.getline(PI[i].name,50); cout<<"\n"; }
for(int k=1;k<serial;k++)
//loop to avoid duplicate entries
{ if(strcmp(PI[i].name,PI[k].name)==0) //if match is found
{ if(entry_index[k]==0)
//if entry is already deleted
{ continue; }
else
//if entry still exists
{ current-=1;
//current no. of entries remains same
cout<<"\n\n\n\tThe patient is already admitted in the hospital !!!";
cout<<"\n\tWant to view info of this registration number in detail (Y/N) : \a";
cin>>duplicate_answer;
while(duplicate_answer!='Y'&&duplicate_answer!='y'&&duplicate_answer!='N'&&duplicate_answer!='n')
{cout<<"\n\t\aPlease re enter a correct option (Y/N) : ";
cin>>duplicate_answer;}
if(duplicate_answer=='y'||duplicate_answer=='Y')
{ entry_index[i]=-1; regis=k;
d_index=1;
show_patient_detail(); }
else
{A1.tasks();} } } }
//end of "for loop" to prevent duplicate entries
cout<<"\nSex ( 1-Male , 2-Female ) : ";
cin>>PI[i].sex;
while(PI[i].sex!=1&&PI[i].sex!=2)
{ cout<<"\a\nInvalid input for sex of patient !!!";
cout<<"\nSex : ";
cin>>PI[i].sex; }
cout<<"\nMartial status( 1-Married , 2-Single ) : ";
cin>>PI[i].martial_status;
while(PI[i].martial_status<1||PI[i].martial_status>2)
{ cout<<"\a\nInvalid input for martial status !!!"<<"\n";
cout<<"Enter a valid martial status : "<<"\n";
cin>>PI[i].martial_status; }
cin.get(ch);
cout<<"\n *** Blood group ***"<<"\n"; cout<<"
1. A+ "<<"\n";cout<<"
2. A- "<<"\n"; cout<<"
3. B+ "<<"\n"; cout<<"
4. B- "<<"\n"; cout<<"
5. AB+ "<<"\n"; cout<<"
6. AB- "<<"\n" cout<<"
7. O+ "<<"\n"; cout<<"
8. O"<<"\n";cout<<"\nEnter a blood group : ";
cin>>PI[i].bld_group;
switch(PI[i].bld_group)
9
{ case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:{
break; }
default:{
while(PI[i].bld_group!=1&&PI[i].bld_group!=2&&
PI[i].bld_group!=3&&PI[i].bld_group!=4&&
PI[i].bld_group!=5&&PI[i].bld_group!=6&&
PI[i].bld_group!=7&&PI[i].bld_group!=8)
{ cout<<"\aInvalid input !!!"<<"\n";
cout<<"Please enter a valid Blood Group : "<<"\n";
cin>>PI[i].bld_group;}
//end of while
break; }}
//end of switch
cin.get(ch);
clrscr();
cout<<"\n\n ***ENTERING ADDRESS**"<<"\n\n";
cout<<"House number : ";
cin>>PI[i].AD1.house;
while(PI[i].AD1.house<=0)
{ cout<<"\a\nInvalid input for house number !!!";
cout<<"\nAgain enter the house number : ";
cin>>PI[i].AD1.house; }
cin.get(ch);
cout<<"Street
: ";
cin.getline(PI[i].AD1.street,30);
while(strlen(PI[i].AD1.street)==0)
{ cout<<"\a\nPlease enter a street : "; //if enter is pressd before input for street
cin.getline(PI[i].AD1.street,50);
cout<<"\n"; }
cout<<"City
: ";
cin.getline(PI[i].AD1.city,30);
while(strlen(PI[i].AD1.city)==0)
{ cout<<"\a\nPlease enter a city : "; //if enter is pressd before input for city cin.getline(PI[i].AD1.city,50);
cout<<"\n"; }
cout<<"District : ";
cin.getline(PI[i].AD1.dist,30);
while(strlen(PI[i].AD1.dist)==0)
{cout<<"\a\nPlease enter a district : "; //if enter is pressed before input for district
cin.getline(PI[i].AD1.dist,30);
cout<<"\n"; }
cout<<"State
: ";
cin.getline(PI[i].AD1.state,30);
while(strlen(PI[i].AD1.state)==0)
{ cout<<"\a\nPlease enter a state : "; //if enter is pressed before input for state
cin.getline(PI[i].AD1.state,50);
cout<<"\n";}
cout<<"Country : ";
cin.getline(PI[i].AD1.country,30);
while(strlen(PI[i].AD1.country)==0)
{ cout<<"\a\nPlease enter a country : "; //if enter is pressd before input for country
cin.getline(PI[i].AD1.country,50); cout<<"\n";}
DOB1.enter_date();
cin.get(ch);
cout<<"\n\nWant to enter information for another patient (Y/N) ? ";
cin>>answer;
while(answer!='Y'&&answer!='y'&&answer!='N'&&answer!='n')
10
{ clrscr();
cout<<"\a\nPease re-enter a correct option (Y/N) : ";cin>>answer; }
//end of "for loop" for entering information
cout<<"\n";
count++;
serial++; }
clrscr();
clrscr();
A1.tasks();}
//end of function
void dob::enter_date()
{ cout<<"\n\n *** Date of birth ***"<<"\n";
cout<<"\nYear : ";
cin>>DOB11[temp].year;
while(DOB11[temp].year>current_year) //to ensure that the year of birth
{
//gets entered correctly
cout<<"\aInvalid input for year !!!";
cout<<"\nThe date of birth cannot be after the current system date !!! ";
cout<<"\nPlease enter the year correctly : ";
cin>>DOB11[temp].year;
cout<<"\n"; }
while(DOB11[temp].year<1000)
{ cout<<"Invalid input for year !!! ";
cout<<"\nThe year of birth must be of 4 digits!!!";
cout<<"\nPlease enter the year correctly : \a";
cin>>DOB11[temp].year;
cout<<"\n";
}
while(DOB11[temp].year<1900)
{ cout<<"\a\nAre you sure (Y/N) ? ";
cin>>birth_answer;
cout<<"\n";
while(birth_answer!='Y'&&birth_answer!='y'&&birth_answer!='N'&&birth_answer!='n')
{ cout<<"\a\nInvalid input !!! "<<"\n";
cout<<"Please enter a correct option (Y/N) : "; cout<<"\n";
cin>>birth_answer; }
if(birth_answer=='n'||birth_answer=='N')
{cout<<"\nPlease enter the year again : ";
cin>>DOB11[temp].year;
while(DOB11[temp].year>current_year)
{ cout<<"Invalid input for year !!! ";
cout<<"\nThe date of birth cannot be after the current system date !!! ";
cout<<"\nPlease enter the year correctly : \a";
cin>>DOB11[temp].year;
cout<<"\n"; }
while(DOB11[temp].year<1000)
{cout<<"\aInvalid input for year !!! ";
cout<<"\nThe year of birth must be of 4 digits!!!\a";
cout<<"\nPlease enter the year correctly : ";
cin>>DOB11[temp].year; cout<<"\n"; } }
while(birth_answer=='y'||birth_answer=='Y')
{ goto jump;}
//end of inner while}
jump:
cout<<"Month : ";
cin>>DOB11[temp].month;
while(DOB11[temp].month<=0||DOB11[temp].month>12)
{ cout<<"\a\nInvalid input for month !!!"<<"\n";
cout<<"Again enter the month : ";
cin>>DOB11[temp].month; }
cout<<"Date : ";
switch(DOB11[temp].month)
11
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:{ cin>>DOB11[temp].date;
//for months with 31 days
while(DOB11[temp].date<1||DOB11[temp].date>31)
{ cout<<"\aInvalid date !!!"<<"\n";
cout<<"Again enter the date : "; cin>>DOB11[temp].date;
cout<<"\n"; }
break; }
case 2:{
//for february
cin>>DOB11[temp].date;
if(DOB11[temp].year%4==0)
{ while(DOB11[temp].date<0||DOB11[temp].date>29) //for leap year
{cout<<"\aInvalid date !!!"<<"\n";
cout<<"Again enter the date : "; cin>>DOB11[temp].date;
cout<<"\n"; } }
else
{while(DOB11[temp].date<0||DOB11[temp].date>28) //for non-leap year
{cout<<"\aInvalid date !!!"<<"\n";
cout<<"Again enter the date : ";
cin>>DOB11[temp].date;
cout<<"\n"; } }
break; }
default:{
cin>>DOB11[temp].date;
//for other months
while(DOB11[temp].date<1||DOB11[temp].date>30)
{ cout<<"\aInvalid date !!!"<<"\n";
cout<<"Again enter the date : ";
cin>>DOB11[temp].date;
cout<<"\n"; }
break; } }
//end of switch
}
//end of function
void all::show_patient_detail()
{ clrscr();
if(d_index==1)
{ d_index=0;
cout<<"\n\n";
goto direct; }
if(current==0)
{ cout<<"\n\n\n";
cout<<"\tDatabase in empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>enter_now;
while(enter_now!='Y'&&enter_now!='y'&&enter_now!='N'&&enter_now!='n')
{cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>enter_now;}
if(enter_now=='y'||enter_now=='Y')
{A1.enter_patient_info();}
else
{A1.tasks();}}
cout<<"\n\t\t****** CURRENT DATEBASE ENTRIES ******\n\n";
cout<<"\t\tRegistration no.
Name of patient\n\n";
for(j=1;j<100;j++)
{if(entry_index[j]==1)
{cout<<"\t\t
"<<j<<"
"<<PI[j].name<<"\n";}
else
12
{continue;}}
cout<<"\n\n\t\tPress 0 to return to main menu.... ";
cout<<"\n\n\n\tEnter registration number : ";
cin>>regis;
clrscr();
cout<<"\n\n";
cin.get(ch);
if(regis==0)
{ A1.tasks();}
show_count++;
direct:
//label for "goto" jump statement
if(regis<=0)
{attempt++;
if(attempt==3)
{cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n";
cout<<"\tAccess Denied!!! "<<"\n";
cout<<"\tPlease try again later. "<<"\n";
cout<<"\tPress any key to exit to main task menu..."<<"\n";
getch();
clrscr();
A1.tasks();}
cout<<"\n\n\tSorry, invalid registration number !!! ";
cout<<"\n\tRegistration number starts from 1 . ";
cout<<"\n\n\tPress any key to continue..... \a";
getch();
A1.show_patient_detail();}
if(regis>0&®is<serial&&entry_index[regis]==0)
{cout<<"\n\tSorry, the patient has left the hospital.";
attempt++;
if(attempt==3)
{cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n";
cout<<"\tAccess Denied!!! "<<"\n";
cout<<"\tPlease try again later. "<<"\n";
cout<<"\tPress any key to exit to main task menu..."<<"\n";
getch();
clrscr();
A1.tasks();}
cout<<"\n\tPress any key to continue..."<<"\n";
getch();}
if((regis<0||regis>=serial)&&entry_index[regis]==-1)
{attempt++;
if(attempt!=3)
{cout<<"\n\n\tSorry, the registration number is invalid ."<<"\n";
entry=serial-1;
if(entry==1)
{cout<<"\tOnly 1 record has been added .\n";}
else
{cout<<"\tOnly "<<entry<<" records have been added .\n";}}
if(attempt==3)
{ cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n";
cout<<"\tAccess Denied!!! "<<"\n";
cout<<"\tPlease try again later. "<<"\n";
cout<<"\tPress any key to exit to main task menu..."<<"\a\n";
getch();
clrscr();
A1.tasks();}
cout<<"\n\n\n\tPress any key to continue.....";
getch();
A1.show_patient_detail();}
if(regis>0&®is<serial&&entry_index[regis]==1)
{attempt=0;
13
cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION NUMBER "<<regis<<"***\n\n";
cout<<"\tName
: "<<PI[regis].name<<"\n";
cout<<"\tSex
: ";
if(PI[regis].sex==1)
{ cout<<"Male "<<"\n"; }
if(PI[regis].sex==2)
{cout<<"Female "<<"\n";}
cout<<"\tBlood Group : ";
switch(PI[regis].bld_group)
{ case 1:{
cout<<"A+\n"; break;
}
case 2:{
cout<<"A-\n";break; }
case 3:{
cout<<"B+\n";break; }
case 4:{
cout<<"B-\n";break;}
case 5:{
cout<<"AB+\n"; break;}
case 6:{cout<<"AB-\n";
break; }
case 7:{ cout<<"O+\n";
break;}
case 8:{
cout<<"O-\n";break; }
}
//end of switch
cout<<"\tDate of birth : ";
DOB1.show_date();
cout<<"\tMartial Status : ";
if(PI[regis].martial_status==1)
{ cout<<"Married "<<"\n"; }
else
{ cout<<"Single "<<"\n"; }
cout<<"\n\t
**ADDRESS**"<<"\n";
cout<<"\n\tHouse no. : "<<PI[regis].AD1.house;
cout<<"\n\tStreet
: "<<PI[regis].AD1.street;
cout<<"\n\tCity
: "<<PI[regis].AD1.city;
cout<<"\n\tDistrict
: "<<PI[regis].AD1.dist;
cout<<"\n\tState
: "<<PI[regis].AD1.state;
cout<<"\n\tCountry
: "<<PI[regis].AD1.country;}
d_index=0;
cout<<"\n\n\n\n\tWant to view detail of another patient : ";
cin>>answer1;
while(answer1!='Y'&&answer1!='y'&&answer1!='N'&&answer1!='n')
{ cout<<"\a\tPease re-enter a correct option (Y/N) ? ";
cin>>answer1; }
clrscr();
if(answer1=='Y'||answer1=='y')
{show_patient_detail(); }
else
{ A1.tasks(); }}
//end of function
void dob::show_date()
{ cout<<DOB11[regis].date;
rem=DOB11[regis].date%10;
switch(DOB11[regis].date)
{
case 11:
case 12:
case 13:
case 14:
14
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:{cout<<"th ";
goto over; } }
//end of switch
switch(rem)
{case 1:{
cout<<"st ";
break; }
case 2:{ cout<<"nd ";
break; }
case 3:{ cout<<"rd "; break; }
default:{
cout<<"th ";
break; } }
//end of switch
over:
switch(DOB11[regis].month)
{
case 1:{ cout<<"January , "; break; }
case 2:{
cout<<"February , ";break; }
case 3:{ cout<<"March , "; break; }
case 4:{cout<<"April , "; break; }
case 5:{ cout<<"May , "; break; }
case 6:{ cout<<"June , ";
break; }
case 7:{ cout<<"July , "; break;}
case 8:{ cout<<"August , "; break; }
case 9:{ cout<<"September , "; break; }
case 10:{ cout<<"October , ";break; }
case 11:{cout<<"November , "; break; }
case 12:{ cout<<"December , "; break; } }
//end of switch
cout<<DOB11[regis].year<<" \n";}
//end of function
//end of function
void all::search_menu()
{ if(current==0)
{ clrscr();
cout<<"\n\n\n";
cout<<"\tDatabase in empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>enter_now;
clrscr();
while(enter_now!='Y'&&enter_now!='y'&&enter_now!='N'&&enter_now!='n')
{cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>enter_now; }
if(enter_now=='y'||enter_now=='Y')
{A1.enter_patient_info(); }
else
{ A1.tasks(); } }
search_number=0;
clrscr();
cout<<"\n\n\t\t
***SEARCH MENU***"<<"\n";
cout<<"\n\n\t\t 1. Search by city "<<"\n";
cout<<"\t\t 2. Search by blood group "<<"\n";
cout<<"\t\t 3. Return to main menu "<<"\n";
cout<<"\n\n\t Enter your choice : \a";
cin>>s_choice;
cin.get(ch);
cout<<"\n\n\n";
15
clrscr();
switch(s_choice)
{
case 1:{ search_index=1;
cout<<"\n\n\t\t***SEARCHING BY CITY***\n";
cout<<"\n\n\tEnter city : ";
cin.getline(s_city,30);
cout<<"\n\n\n";
while(strlen(s_city)==0) //if enter is pressed before input for city
{ cout<<"\n\tPlease enter a city : \a";
cin.getline(s_city,30); }
A1.search_city();
break; }
case 2:{ search_index=2;
cout<<"\n\n\t\t***SEARCHING BY BLOOD GROUP***\n";
cout<<"\n\n\t\t ***BLOOD GROUP MENU***\n\n";
cout<<"\t1. A+ "<<"\n";
cout<<"\t2. A- "<<"\n";
cout<<"\t3. B+ "<<"\n";
cout<<"\t4. B- "<<"\n";
cout<<"\t5. AB+ "<<"\n";
cout<<"\t6. AB- "<<"\n";
cout<<"\t7. O+ "<<"\n";
cout<<"\t8. O- "<<"\n";
cout<<"\n\n
Enter the serial of your required group : ";
cin>>s_group;
while(s_group!=1&&s_group!=2&&s_group!=3&&s_group!=4&&
s_group!=5&&s_group!=6&&s_group!=7&&s_group!=8)
{cout<<"\n";
cout<<"\tInvalid search criteria !!!"<<"\n";
cout<<"\tValid serials are 1 to 8."<<"\n";
cout<<"\tEnter a valid blood group : \a";
cin>>s_group; }
cout<<"\n\n\n";
A1.search_blood_group();
break; }
case 3:{ A1.tasks(); break; }
default:{ cout<<"\a\n\n Invalid search criteria !!!"<<"\n";
cout<<" Valid options are 1 and 2 !!!"<<"\n";
cout<<" Press any key to return to the main searching menu....."<<"\n";
getch();
search_menu();
break;} }
//end of switch}
//end of function
void all::search_city()
{ search_count=0;
search_number++;
clrscr();
cout<<"\n\n\n";
for(index=1;index<serial;index++)
{if((strcmp(PI[index].AD1.city,s_city))==0)
{ if(entry_index[index]==0)
{ continue; }
if(search_count==0)
{ cout<<"\t\tRegistration no.
Name of patient\n\n"; }
cout<<"\n\t\t
"<<index<<"\t\t"<<PI[index].name;
search_count++; } }
if(search_number==1)
{ cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n";
if(search_count==0)
{ cout<<"\t\t No result found !!!"<<"\n\n\n";
cout<<"\t\t Press any key to continue.....";
16
getch();
A1.after_search_options(); }
if(search_count>1)
{cout<<"\t\t "<<search_count<<" results found !!! "<<"\n\n\n"; }
if(search_count==1)
{ cout<<"\t\t "<<search_count<<" result found !!! "<<"\n\n\n"; } }
if(search_number==1)
{cout<<"\n\n\t\tWant to view in detail : ";
cin>>after_search_answer;
while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_answer!='N'&&after_search_answer!='n')
{ cout<<"\a\n\n\t\tPlease enter a correct option .";
cout<<"\n\t\tDo you want to view in detail : ";
cin>>after_search_answer; }
if(after_search_answer=='y'||after_search_answer=='Y')
{ cout<<"\n\n\n\t\tWhich registration number : ";
cin>>index;
A1.search_show_info(); }
else
{ A1.after_search_options(); } }
else
{cout<<"\n\n\n\t\tWhich registration number : "; cin>>index; A1.search_show_info();}}
//end of function
void all::search_blood_group()
{ search_count=0;
search_number++;
clrscr();
cout<<"\n\n\n";
for(index=1;index<serial;index++)
{ if(s_group==PI[index].bld_group)
{ if(entry_index[index]==0)
{ continue; }
if(search_count==0)
{ cout<<"\t\tRegistration no.
Name of patient\n\n"; }
cout<<"\n\t\t
"<<index<<"\t\t"<<PI[index].name;
search_count++; } }
if(search_number==1)
{ cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n";
if(search_count==0)
{ cout<<"\t\t No matching result found !!!"<<"\n\n\n";
cout<<"\t\t Press any key to continue.....";
getch();
A1.after_search_options();}
if(search_count>1)
{cout<<"\t\t "<<search_count<<" results found !!! "<<"\n\n\n"; }
if(search_count==1)
{cout<<"\t\t "<<search_count<<" result found !!! "<<"\n\n\n"; } }
if(search_number==1)
{cout<<"\n\n\t\tWant to view in detail : ";
cin>>after_search_answer;
while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_answer!='N'&&after_search_answer!='n')
{ cout<<"\a\n\n\t\tPlease enter a correct option .";
cout<<"\n\t\tDo you want to view in detail : ";
cin>>after_search_answer; }
if(after_search_answer=='y'||after_search_answer=='Y')
{cout<<"\n\n\n\t\tWhich registration number : ";
cin>>index;
A1.search_show_info(); }
else
{ A1.after_search_options(); } }
else
{cout<<"\n\n\n\t\tWhich registration number : ";
cin>>index;
A1.search_show_info(); }}
//end of function
17
void all::search_show_info()
{ ssi_count++;
clrscr();
cout<<"\n\n";
if(index<=0)
{ if(ssi_count==3)
{ clrscr();
cout<<"\n\n\tYou have entered wrong choice 3 times!!!!";
cout<<"\n\tPress any key for more options......\a";
getch();
A1.after_search_options(); }
cout<<"\n\n\tSorry, invalid registration number !!!";
cout<<"\n\tRegistration number starts from 1 ";
cout<<"\n\tPress any key to continue.........\n";
getch();
switch(search_index)
{
case 1:{ A1.search_city(); break; }
case 2:{ A1.search_blood_group(); break;} }
//end of switch }
if(entry_index[index]==0)
{if(ssi_count==3)
{ clrscr();
cout<<"\n\n\tYou have entered wrong choice 3 times!!!!";
cout<<"\n\tPress any key for more options......\a";
getch();
A1.after_search_options(); }
cout<<"\n\n\tSorry, the patient has left the hospital ."<<"\n";
cout<<"\tPress any key to continue ....\a"<<"\n";
getch();
switch(search_index)
{
case 1:{ A1.search_city(); break; }
case 2:{
A1.search_blood_group(); break; } }
//end of switch }
if(entry_index[index]==-1||index>=serial)
{if(ssi_count==3)
{clrscr();
cout<<"\n\n\tYou have entered wrong choice 3 times!!!!";
cout<<"\n\tPress any key for more options......\a";
getch();
A1.after_search_options(); }
cout<<"\n\n\t\tSorry, the registration number in invalid ."<<"\n";
entry=serial-1;
if(entry==1)
{ cout<<"\t\tOnly 1 record has been added .\n";}
else
{ cout<<"\t\tOnly "<<entry<<" records have been added .\n"; }
cout<<"\t\tPress any key to continue....\a"<<"\n";
getch();
switch(search_index)
{
case 1:{
A1.search_city(); break }
case 2:{
A1.search_blood_group(); break; } }
//end of switch }
cout<<"\n";
ssi_count=0;
cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION NUMBER "<<index<<"***\n\n";
cout<<"\tName
: "<<PI[index].name<<"\n";
cout<<"\tSex
: ";
if(PI[index].sex==1)
{ cout<<"Male "<<"\n";
18
}
if(PI[index].sex==2)
{ cout<<"Female "<<"\n"; }
cout<<"\tBlood Group : ";
switch(PI[index].bld_group)
{
case 1:{
cout<<"A+\n"; break; }
case 2:{ cout<<"A-\n";
break; }
case 3:{
cout<<"B+\n"; break; }
case 4:{
cout<<"B-\n"; break; }
case 5:{
cout<<"AB+\n"; break; }
case 6:{ cout<<"AB-\n"; break; }
case 7:{ cout<<"O+\n"; break; }
case 8:{ cout<<"O-\n";
break; } }
//end of switch
cout<<"\tDate of birth : ";
DOB1.search_show_date();
cout<<"\tMartial Status : ";
if(PI[index].martial_status==1)
{ cout<<"Married "<<"\n";}
else
{ cout<<"Single "<<"\n";}
cout<<"\n\t
**ADDRESS**"<<"\n";
cout<<"\n\tHouse no. : "<<PI[index].AD1.house;
cout<<"\n\tStreet
: "<<PI[index].AD1.street;
cout<<"\n\tCity
: "<<PI[index].AD1.city;
cout<<"\n\tDistrict
: "<<PI[index].AD1.dist;
cout<<"\n\tState
: "<<PI[index].AD1.state;
cout<<"\n\tCountry
: "<<PI[index].AD1.country;
cout<<"\n\n\n\tWant to view info of another patient within search results (Y/N) ? ";
cin>>after_search_answer;
while(after_search_answer!='Y'&&after_search_answer!='y'&&after_search_answer!='N'&&after_search_answer!='n')
{ cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>after_search_answer; }
if(after_search_answer=='y'||after_search_answer=='Y')
{ switch(search_index)
{
case 1:{ A1.search_city(); break; }
case 2:{
A1.search_blood_group(); break; } }
//end of switch }
else
{ A1.after_search_options(); }}
//end of function
void dob::search_show_date()
{ cout<<DOB11[index].date;
rem=DOB11[index].date%10;
switch(DOB11[index].date)
{
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:{ cout<<"th ";
19
goto over; } }
//end of switch
switch(rem)
{
case 1:{
cout<<"st "; break; }
case 2:{
cout<<"nd "; break;}
case 3:{
cout<<"rd "; break;}
default:{
cout<<"th "; break; } }
//end of switch
over:
switch(DOB11[index].month)
{
case 1:{
cout<<"January , "; break; }
case 2:{
cout<<"February , "; break; }
case 3:{
cout<<"March , "; break; }
case 4:{
cout<<"April , "; break; }
case 5:{
cout<<"May , "; break; }
case 6:{
cout<<"June , "; break; }
case 7:{
cout<<"July , "; break; }
case 8:{
cout<<"August , "; break; }
case 9:{
cout<<"September , "; break; }
case 10:{
cout<<"October , "; break; }
case 11:{
cout<<"November , "; break; }
case 12:{
cout<<"December , "; break; } }
//end of switch
cout<<DOB11[index].year<<" \n";
}
//end of function
void all::after_search_options()
{ clrscr();
cout<<"\n\n\n\n\t\tWHAT DO U WANT TO DO NOW ?"<<"\n";
cout<<"\t\t1. Search again "<<"\n";
cout<<"\t\t2. Return to main task menu "<<"\n";
cout<<"\n\tEnter your choice : ";
cin>>after_search_choice;
cout<<"\n";
switch(after_search_choice)
{case 1:{
ssi_count=0;
A1.search_menu(); break;}
case 2:{
ssi_count=0;
A1.tasks(); break; }
default:{
cout<<"\a\n\n\tInvalid option requested !!!"<<"\n";
cout<<"\tPress any key to return to the main searching menu..."<<"\n";
getch();
A1.search_menu();
20
break; } }
//end of switch
}
//end of function
void all::delete_entry()
{clrscr();
if(current==0)
{cout<<"\n\n\n";
cout<<"\tDatabase in empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>enter_now;
while(enter_now!='Y'&&enter_now!='y'&&enter_now!='N'&&enter_now!='n')
{ cout<<"\a\n\tPlease re-enter a correct option (Y/N) : ";
cin>>enter_now; }
if(enter_now=='y'||enter_now=='Y')
{ A1.enter_patient_info(); }
else
{ A1.tasks(); }}
cout<<"\n\t\t ***CURRENT DATABASE ENTRIES***\n\n";
cout<<"\t\tRegistration no.
Name of patient\n\n";
for(j=1;j<serial;j++)
{ if(entry_index[j]==0)
{ continue;
//to ignore deleted items
} if(entry_index[j]==1)
{delete_show++;
cout<<"\t\t
"<<j<<"
"<<PI[j].name<<"\n";}}
if(delete_show==0)
{clrscr();
cout<<"\n\tDatabase is currently empty!!!\a";
cout<<"\n\tPress any key to continue....";
getch();
A1.tasks();
}cout<<"\n\n\tPress 0 to return to main menu and 101 to delete all entries... ";
cout<<"\n\n\n\tWhich registration no. to delete ? ";
cin>>en_del_index;
if(en_del_index==101)
{ cout<<"\n\tWarning : You are about to delete all entries !!!\a";
cout<<"\n\tAre you sure you want to do this : ";
cin>>delete_all_confirm;
while(delete_all_confirm!='Y'&&delete_all_confirm!='y'&&delete_all_confirm!='N'&&delete_all_confirm!='n')
{ cout<<"\n\tSorry, wrong input !!!";
cout<<"\n\tPlease enter a valid choice (Y/N) : \a";
cin>>delete_all_confirm; }
if(delete_all_confirm=='y'||delete_all_confirm=='Y')
{for(f=1;f<=100;f++)
{ if(entry_index[f]==1)
{ current--;
entry_index[f]=0; } }
cout<<"\n\n\tAll entries have been succesfully deleted!!!";
cout<<"\n\tPress any key to return to the main menu...\a";
getch();
A1.tasks(); }
else
{cout<<"\n\tNo entries have been deleted.";
cout<<"\n\tPress any key for more options....";
getch();
A1.after_delete_options(); } }
if(en_del_index==0)
{clrscr();
A1.tasks(); }
if(en_del_index>0&&en_del_index<serial&&entry_index[en_del_index]==1)
{ delete_attempt=0;
cout<<"\n\n\tAre you sure you want to delete entry "<<en_del_index<<" (Y/N) ? ";
21
cin>>delete_confirm;
while(delete_confirm!='Y'&&delete_confirm!='y'&&delete_confirm!='N'&&delete_confirm!='n')
{ cout<<"\a\n\tPease re-enter a correct option (Y/N) ? ";
cin>>delete_confirm; }
if(delete_confirm=='y'||delete_confirm=='Y')
{ entry_index[en_del_index]=0; //entry now deleted. index value set to 0
current--;
cout<<"\n\tEntry succesfully deleted.\n";
cout<<"\tPress any key to continue.....\a";
getch();
A1.after_delete_options(); }
else
{ entry_index[en_del_index]=1; //entry not deleted. default index value(1) kept
cout<<"\n\tEntry not deleted ";
cout<<"\n\tPress any key to continue.......";
getch();
A1.after_delete_options(); } }
if(en_del_index>0&&en_del_index<serial&&entry_index[en_del_index]==0)
{ delete_attempt++;
if(delete_attempt==3)
{ cout<<"\n\n\tSorry, you have entered wrong registration number 3 times. ";
cout<<"\n\tAccess denied !!!";
cout<<"\n\tPlease try again later !!!";
cout<<"\n\tPress any key to return to the main task menu....\a";
getch();
A1.tasks(); }
cout<<"\n\n\tSorry, the patient has already left the hospital ."<<"\n";
cout<<"\n\tPress any key to continue...\a"<<"\n";
getch();
delete_entry(); }
else
{ delete_attempt++;
if(delete_attempt==3)
{ cout<<"\n\n\tSorry, you have entered wrong registration number 3 times. ";
cout<<"\n\tAccess denied !!!";
cout<<"\n\tPlease try again later !!! ";
cout<<"\n\tPress any key to return to the main task menu....\a";
getch();
A1.tasks(); }
cout<<"\n\n\tSorry, Invalid registration number ."<<"\a\n";
entry=serial-1;
if(entry==1)
{cout<<"\tOnly 1 record has been added .\n";}
else
{cout<<"\tOnly "<<entry<<" records was added and "<<current<<" are present .\n";}
cout<<"\tPress any key to continue..."<<"\n";
getch();
delete_entry();}
clrscr();}
//end of function
void all::after_delete_options()
{clrscr();
cout<<"\n\t\tWHAT DO YOU WANT TO DO NOW ?";
cout<<"\n\t\t1. Delete more entries ";
cout<<"\n\t\t2. Return to main menu "<<"\n";
cout<<"\n\t\tPlease enter your choice : ";
cin>>delete_choice;
while(delete_choice!=1&&delete_choice!=2)
{ cout<<"\a\n\n\tSorry, wrong choice .";
cout<<"\n\tValid choices are 1 and 2. ";
cout<<"\n\tPlease re-enter your choice : ";
cin>>delete_choice; }
22
switch(delete_choice)
{
case 1:{
A1.delete_entry();break; }
case 2:{
A1.tasks();
break; } }
//end of switch
}
//end of function
void all::recycle_bin()
{ clrscr();
delete_count=0;
if(serial==0)
{ cout<<"\n\n\n";
cout<<"\tDatabase in empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>enter_now;
while(enter_now!='Y'&&enter_now!='y'&&enter_now!='N'&&enter_now!='n')
{cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>enter_now; }
if(enter_now=='y'||enter_now=='Y')
{ A1.enter_patient_info();}
else
{ A1.tasks();} }
cout<<"\n\t\t ****** DELETED ENTRIES ******\n\n";
cout<<"\t\tRegistration no.
Name of patient\n\n";
for(d=1;d<serial;d++)
{if(entry_index[d]==0)
{ cout<<"\t\t
"<<d<<"
"<<PI[d].name<<"\n";
delete_count++; }
else
{continue; }}
if(delete_count==0)
{ delete_count=0;
clrscr();
cout<<"\n\n\n\tNo entry is currently in recycle bin.";
cout<<"\n\tPress any key to return to the main menu...\a";
getch();
A1.tasks(); }
cout<<"\n\n\tPress 0 to return to main menu and 101 to restore all items... ";
cout<<"\n\n\n\tWhich item to restore : ";
cin>>restore_serial;
if(restore_serial==0)
{clrscr();
A1.tasks();}
if(restore_serial==101)
{ cout<<"\n\n\tAre you sure you want to restore all the entries : ";
cin>>restore_all_confirm;
while(restore_all_confirm!='Y'&&restore_all_confirm!='y'&&restore_all_confirm!='N'&&restore_all_confirm!='n')
{ cout<<"\n\n\tPlease re-enter a corrent option : ";
cin>>restore_all_confirm; }
if(restore_all_confirm=='y'||restore_all_confirm=='Y')
{ for(e=1;e<=100;e++)
{if(entry_index[e]==0)
{ current++;
entry_index[e]=1; } }
cout<<"\n\tAll deleted items have been succesfully restored.";
cout<<"\n\tPress any key to return to the main menu...";
getch();
clrscr();
A1.tasks(); }
23
else
{cout<<"\n\n\tNo entry has been restored.";
cout<<"\n\tPress any key to view the recycle bin...\a";
getch();
clrscr();
recycle_bin(); }}
if(entry_index[restore_serial]==0)
{ restore_attempt=0;
cout<<"\n\tAre you sure you want to restore entry "<<restore_serial<<" : ";
cin>>restore_confirm;
while(restore_confirm!='Y'&&restore_confirm!='y'&&restore_confirm!='N'&&restore_confirm!='n')
{cout<<"\n\n\tInvalid input !!! ";
cout<<"\n\tPease re-enter a correct option (Y/N) : \a";
cin>>restore_confirm;}
if(restore_confirm=='Y'||restore_confirm=='y')
{ current++;
delete_count=0;
entry_index[restore_serial]=1;
//index value set to 1
cout<<"\n\tEntry succesfully restored!!!";
cout<<"\n\tPress any key to continue....\a";
getch();
A1.after_restore();}
else
{cout<<"\n\tEntry not restored!!!";
//index value kept 0
cout<<"\n\tPress any key to continue...\n\a";
getch();
A1.after_restore();}}
if(entry_index[restore_serial]==1)
{restore_attempt++;
if(restore_attempt==3)
{clrscr();
cout<<"\n\n\tYou have unsuccesfully tried to restore 3 times.";
cout<<"\n\tPress any key to return to the main task menu...";
A1.tasks();}
cout<<"\n\tThe entry is already present in the database.";
cout<<"\n\tPress any key to continue...";
getch();
recycle_bin();}
if(restore_serial<0||restore_serial>100||entry_index[restore_serial]==-1)
{restore_attempt++;
if(restore_attempt==3)
{clrscr();
cout<<"\n\n\tYou have unsuccesfully tried to restore 3 times.";
cout<<"\n\tPress any key to return to the main task menu...";
getch();
A1.tasks();
}cout<<"\n\tInvalid serial number";
cout<<"\n\tPress any key to continue...";
getch();
recycle_bin(); }}
//end of function
void all::after_restore()
{clrscr();
cout<<"\n\n\n\t\tWHAT DO YOU WANT TO DO NOW? ";
cout<<"\n\t\t1. Restore more entries ";
cout<<"\n\t\t2. Return to main manu ";
cout<<"\n\n\t\tPlease enter your choice : ";
cin>>after_restore_choice;
switch(after_restore_choice)
{case 1:{
A1.recycle_bin();
break;}
24
case 2:{
A1.tasks();
break;}
default:{ cout<<"\n\n\n\tSorry, wrong choice ";
cout<<"\n\tValid choices are 1 and 2 ";
cout<<"\n\tPress any key to continue......";
getch();
A1.after_restore();} }
}
//end of function
void all::software_detail()
{clrscr();
cout<<"\n\n\n\t\t\t ***SOFTWARE DETAILS***\n";
cout<<"\n\n\tDeveloper
: Madiha and Marwa"<<"\n";
cout<<"\tProgramming Language : C++ "<<"\n";
cout<<"\tCompiler version
: turboc++ 3.0 "<<"\n";
cout<<"\tAim
: Simulation of Hospital Management Software"<<"\n";
cout<<"\n\tHope you like it..."<<"\n";
cout<<"\n\n\tSend your comments to : m_01@yahoo.com "<<"\n";
cout<<"\n\n\tThank You for trying this program. "<<"\n";
cout<<"\a\n\n\n\tPress any key to return to the main task menu......."<<"\n";
getch();
A1.tasks();}
void all::exit_function()
{clrscr();
if(serial==0)
{cout<<"\n\n\n\n\tYou have not used the software.";
cout<<"\n\tIt is recommended that you do not exit.";
cout<<"\n\tPress any key to continue......\a";
getch();
clrscr();
cout<<"\n\n\n\tAre you sure you want to exit (Y/N) ? ";
cin>>exit_answer;
while(exit_answer!='Y'&&exit_answer!='y'&&exit_answer!='N'&&exit_answer!='n')
{cout<<"\n\n\tInvalid input !!! ";
cout<<"\n\tPlease re-enter a correct option (Y/N) : \a";
cin>>exit_answer;}
if(exit_answer=='y'||exit_answer=='Y')
{cout<<"\a";
exit(0);}
else
{A1.tasks(); }}
else
{cout<<"\n\n\n\tAre you sure you want to exit (Y/N) ? ";
cin>>exit_answer;
while(exit_answer!='Y'&&exit_answer!='y'&&exit_answer!='N'&&exit_answer!='n')
{ cout<<"\n\n\tInvalid input !!! ";
cout<<"\n\tPlease re-enter a correct option (Y/N) : \a";
cin>>exit_answer;}
if(exit_answer=='y'||exit_answer=='Y')
{ cout<<"\a";
exit(0);}
else
{ A1.tasks();
}} }
//end of function
void main()
//main function
{ clrscr();
textbackground(3);
textcolor(1);
for(int m=1;m<=100;m++) //default index value set to -1 for each entry
{entry_index[m]=-1;}
cout<<"Welcome to..."<<"\n";
cout<<"\n\n\t\t\t***HOSPITAL MANAGEMENT SOFTWARE***"<<"\n";
25
cout<<"\t\t\t
By Madiha and Marwa "<<"\n";
D1.enter_date(); A1.tasks();
}
//end of main function
OUTPUT:
ENTERING DATE:
26
27
ERROR CHECKING:
28
DETAIL OF PATIENT:
29
SEARCHING BY CITY:
30
31
32
33
DELETING AN ENTERY:
RECYCLE BIN:
34
RESTORING ENTERIES:
35
ABOUT SOFTWARE:
36
EXIT: