//Geshu Sinha XI Sc.A
//Project Work
#include<iostream.h>
#include<string.h>
#include<stdio.h>
#include<conio.h>
struct feed //structure declared
{
char m[4];
char n[4];
}; //structure declared
struct pat
{
char name[5]; //father's name
char fname[5];
char address[10];
int age;
};
struct diag //structure declared
{
char probd[5];
char solg[10];
char medg[5];
};
struct doc //structure declared
{
char named[5];
char spec[5];
int exp;
};
struct total //structure declared
{
feed a;
pat b;
diag c;
doc d;
}; //main program starts
main()
{
cout<<"THE PROGRAM IS MADE WITH AN EFFORT TO EMPHASIZE ON DIGITAL INDIA DEVELOPED INDIA";
total e[10];
int f=0;
cout<<"tell number of patients\n------";
cin>>f;
int g=0;
while(g<f) //while loop to run the program number of times wanted
{
{
cout<<"Enter 'listp' to get the list of supported places\n------";
char h[5];
gets(h);
if(strcmpi(h,"listp")==0) //switch case used
{
{
cout<<"Enter 1 for Delhi\n";
cout<<"enter 2 for Chennai\n";
cout<<"Enter 3 for Lucknow\n";
}
int i=0;
cout<<"enter the required option\n";
cin>>i;
switch(i)
{ //switch case
case 1: cout<<"You selected Delhi";break;
case 2: cout<<"You selected Chennai"; break;
case 3: cout<<"You selected Lucknow";break;
}
cout<<endl;
cout<<"Enter listh to get list of hospital\n";
gets(h);
if(strcmpi(h,"listh")==0)
{
cout<<"Enter 1 for RML\n";
cout<<"Enter 2 for AIIMS\n";
cout<<"Enter 3 for City Hospital\n";
}
int j=0;
cout<<"enter required option\n";
cin>>j;
switch(j)
{
case 1 : cout<<"You are being connceted to RML\n"; break;
case 2 : cout<<"You are being connected to AIIMS\n"; break;
case 3 : cout<<"You are being connected to City Hospital\n"; break;
}
cout<<endl;
}
g++;
}
}
cout<<"Now it is time to get details for each Patient\n"; //getting entry for structures
for(int k=0; k<f; k++)
{
cout<<"Tell Patient's name\n";
gets(e[k].b.name);
cout<<"\n";
cout<<"Tell Patient's age\n";
cin>>e[k].b.age;
cout<<"\n";
cout<<"Tell Patient's Father's Name\n";
gets(e[k].b.fname);
cout<<"\n";
cout<<"Tell the address\n";
gets(e[k].b.address);
cout<<"\n";
cout<<"********************************\n";
cout<<"The network transferred to the Doctor\n";
cout<<"Now Doctor will tell his details and then give the required Diagnostic\n";
cout<<endl;
cout<<"Doctor's name is\n";
gets(e[k].d.named);
cout<<"\n";
cout<<"Now my specialisation is \n";
gets(e[k].d.spec);
cout<<"\n";
cout<<"Now Doctor will tell about his experience(in years)\n";
cin>>e[k].d.exp;
cout<<endl;
cout<<"************************************************************\n";
cout<<"The network tranferred again to the patient\n";
cout<<"Now it's turn of Patient to tell the problem and then Doctor will give the required solution";
cout<<"\n";
cout<<"Tell the problem\n";
gets(e[k].c.probd);
cout<<"\n";
cout<<"My Solution is\n";
gets(e[k].c.solg);
cout<<"\n";
cout<<"You need to take medicine\n";
gets(e[k].c.medg);
cout<<"\n";
cout<<"*****************************************\n";
cout<<"Now it is time for feedback for the task\n";
cout<<"Do you want to give the feedback or not\n";
gets(e[k].a.m);
{
if(strcmpi(e[k].a.m,"y")==0)
cout<<"Give the Feedback\n";
gets(e[k].a.n);
cout<<"\n";
if(strcmpi(e[k].a.m,"y")==1)
cout<<"You never wanted to give feedback(y for yes ohterwise any)\n";
}
}
cout<<"********************************\n";
cout<<"Search using patient's name the data of patient\n"; //search using patient name
char r[5];
clrscr();
cout<<"Tell patient's name to get data for\n";
gets(r);
f=f;
int s=0;
while(s<f)
{
if(strcmpi(r,e[s].b.name)==0)
{
cout<<"Patient's name\n";
puts(e[s].b.name);
cout<<"\n";
cout<<"The problem was\n";
puts(e[s].c.probd);
cout<<"\n";
cout<<"The solution given was\n";
puts(e[s].c.solg);
cout<<"\n";
cout<<"The advised medicine was\n";
puts(e[s].c.medg);
cout<<"\n";
cout<<"The Doctor who gave treatment was\n";
puts(e[s].d.named);
cout<<"\n";
}
s++;
}
cout<<"I hope uou all enjoyed the working and wish India to go on for this";
}