#include<iostream.h>
#include<string.h>
void main()
{
int ch,n,phy_id[10],phy_workex[22];
char phy_name[12],phy_spec[30];
char pat_name[20],pat_gender[10],pat_case[50],ass_phy[12];
int m,pat_age[4],pat_cardno[20],pat_date[4];
do
{
cout<<"\t\t\t TASK SELECTION WINDOW \n";
cout<<"\t\t\t ********************* \n";
cout<<"\t What would you like to do ?\n";
cout<<"\t Please enter the number you choice \n";
cout<<"\t 1.Register a physician/s \n";
cout<<"\t 2.Register a patient/s \n";
cout<<"\t 3.Edit physician or patient information \n";
cout<<"\t 4.Delete patient or physician information \n";
cout<<"\t 5.List all available physicians \n";
cout<<"\t 6.List all registered patients \n";
cout<<"\t 7.Search for a patient \n";
cout<<"\t 8 Search for a physician \n";
cout<<"\t 9.Quit a program \n";
cout<<endl;
cout<<"Please enter your selection !\n";
cin>>ch;
}
switch(ch)
{
case '1':
cout<<"\t How many physician you want to register ?\n";
cin>>n;
cout<<"Enter name,id,specification and work experiance of "<<n<<"physicians"<<endl;
cout<<"--------------------------------------------------------------"<<endl;
for(int i=0;i<n;i++)
{
cout<<"\nEnter physician "<<i<<"name :";
cin>>phy_name[i];
cout<<"Enter physician "<<i<<"id :";
cin>>phy_id[i];
cout<<"\nEnter physician "<<i<<"specification :";
cin>>phy_spec[i];
cout<<"\n Enter physician "<<i<<"work experiance :";
cin>>phy_workex[i];
cout<<endl;
}
break;
case 2:
cout<<"\t How many patient you want to register ?\n";
cin>>m;
cout<<"Enter name,age,gender,card no,case,date and assigned physician of"<<m<<"patients"<<endl;
cout<<"-------------------------------------------------------------------------"<<endl;
for(int j=0;j<m;j++)
{
cout<<"\n Enter patient "<<i<<"name :";
cin>>pat_name[i];
cout<<"\n Enter patient "<<i<<"age :";
cin>>pat_age[i];
cout<<"\nEnter patient "<<i<<"gender";
cin>>pat_gender[i];
cout<<"\n enter patient "<<i<<"card number :";
cin>>pat_cardno[i];
cout<<"\n Enter patient"<<i<<"case :";
cin>>pat_case[i];
cout<<"\n Enter patient "<<i<<"date :";
cin>>pat_date[i];
cout<<"\n Enter patient "<<i<<"assigned physician :";
cin>>ass_phy[i];
cout<<endl;
}
break;
case 3:
cout<<"\t\tprogram to edit physician or patient information \n";
case 4:
cout<<"\tProgram to delete physician or patient information \n";
cout<<"\t----------------------------------------------------"<<endl;
char choose,delphy_name[12];
int
cout<<"Enter phy to delete physician information \n";
cout<<"enter pat to delete patient information \n";
if(choose==phy)
cin>>del_name[10];
for(i=0;i<n;i++)
{
if(strcmp(phy_name[1],delphy_name)==0)
found=i;
if(check==1)
for(i=found;i<n;i++)
{
strcpy(id[found,id[found+1]);
}
else
cout<<"\n not found !";
break;
case 5:
cout<<"\t program to list all available physicians \n";
cout<<"\t Number "<<"\t name "<<"\t ID "<<"\t specification "<<"\t work exepriance \n";
for(i=0;i<n;i++)
{
cout<<\t i+1<<"\t"<<phy_name[i]<<"\t"<<phy_id[i];
cout<<"\t"<<phy_spec[i]<<"\t"<<phy_workex[i];
cout<<endl;
}
break;
case 6:
cout<<"\t\tprogram to list all registered patients \n";
cout<<"\t number "<<"\t name "<<"\tage"<<"\t gender"<<"\t card number \n";
cout<<"\t case\n"<<"\t date"<<"\t assigned physician";
cout<<endl;
for(j=0;j<m;j++)
{
cout<<\t i+1<<"\t"<<pat_name[i]<<"\t"<<pat_age[i]<<"\t"<<pat_gender[i];
cout<<"\t"<<pat_cardno[i]<<"\t"<<pat_case[i]<<"\t"<<pat_date[i];
cout<<"\t<<ass_phy[i]<<endl;
}
break;
case 7:
cout<<"\t program to search for a patient \n";
char search_patname[12];
int check=0;
int found;
cin>>search_patname;
for(i=0;i<n;i++)
{
if(strcmp(pat_name,search_patname)==0)
}
ckeck=1;
found=i;
if(ckeck=1);
{
cout<<pat_name[found];
cout<<pat_age[found];
}
else
cout<<"\n not found \n";
break;
case 8:
cout<<"\t program search for a physician \n";
char search_phyname[12];
int check;
int found;
cin>>search_phyname;
for(j=0;j<m;j++)
{
if(strcmp(phy_name,searchphyname)==0)
}
ckeck=0;
found=i;
if(ckeck=1)
{
cout<<phy_name[found];
cout<<phy_id[found];
}
else
cout<<"\n not found\n";
break;
case 9:
cout<<"\tCongratulation you finished your program \n";
break;
}
while((ch>9)||(ch<1));
}
Recommended Answers
Jump to PostIf you have done your program like above, but not run & edit program, then run & edit program, then ask specific question.
And use code tags.
All 4 Replies
nucleon
114
Posting Pro in Training
death_oclock
103
Posting Whiz
sisse56
-11
Newbie Poster
Freaky_Chris
commented:
Warned about code tags, and now on 12 posts
-1
Freaky_Chris
299
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.