You are on page 1of 6

Hafiz Muhammad Abdullah Khan

BS Biomedical Engineering Technology


F-19-BSBM-012

Introduction to Computing
Dr. Ateeq-ur-Rehman
Assignment
Hospital Management Program:-
#include<iostream>

using namespace std;

int addition(int x, int y)

int add=x+y;

return add;

int main()

int p_id, e=250, t=360, h=800, s=500, th=1000;

string p_name, dr_name;

char ans;

string eyes="Systane";

string throat="Cefixyme";

string heart="Cardiolip";

string skin="Antihistamine";

string therapist="Celexa";

cout<<"** ** ** Foundation Hospital ** ** **"<<endl;

proc:

cout<<"What is your name?"<<endl;

cin>>p_name;

cout<<"Enter your id"<<endl;

cin>>p_id;

if(p_name=="Abdullah"&& p_id==1234)

cout<<"Hello Abdullah"<<endl<<"You are a patient of"<<endl;


cout<<"Asthma"<<endl<<"You are suffering from depression"<<endl;

else if(p_name=="Marib"&&p_id==3456)

cout<<"Hello Marib"<<endl<<"You are a patient of"<<endl<<" high blood pressure"<<endl;

cout<<"Dermatitis"<<endl;

else {

cout<<"No record found";

goto proc;

procc:

cout<<"Which doctor do you want to visit"<<endl;

cout<<"1. Dr Ateeq (Therapist)"<<endl<<"2.Dr Umair(Cardiologist)"<<endl;

cout<<"3. Dr Salman (General Surgeon)"<<endl<<"4. Dr Azlan(Dermatologist)"<<endl;

cin>>dr_name;

if(dr_name=="Ateeq")

cout<<"I'm writing you an anti-deppressant"<<endl;

cout<<"Medicine= "<<therapist<<endl;

else if(dr_name=="Umair")

cout<<"Your heartbeat rate has got worse"<<endl;

cout<<"I'm doubling your dose of medicine"<<endl;

cout<<"Medicine= "<<heart<<endl;

}
else if(dr_name=="Salman")

cout<<"You have a sore throat and a swollen eye"<<endl;

cout<<"Medicines= 1."<<eyes<<" 2."<<throat<<endl;

else if(dr_name=="Azlan")

cout<<"You have dermatitis"<<endl;

cout<<"Medicine= "<<skin<<endl;

else

cout<<"Invalid Entry"<<endl<<"Do you want to try again? (y/n)"<<endl;

cin>>ans;

if(ans=='y')

goto procc;

else

goto end;

//Receipt

if(dr_name=="Ateeq")

{
cout<<"*** YOUR RECEIPT ***"<<endl;

cout<<"Your total bill is "<<th<<"$"<<endl;

else if(dr_name=="Umair")

cout<<"*** YOUR RECEIPT ***"<<endl;

cout<<"Your total bill is "<<h<<"$"<<endl;

else if(dr_name=="Salman")

cout<<"*** YOUR RECEIPT ***"<<endl;

cout<<"Your total bill is "<<addition(e,t)<<"$"<<endl;

else if(dr_name=="Azlan")

cout<<"*** YOUR RECEIPT ***"<<endl;

cout<<"Your total bill is "<<s<<"$"<<endl;

end:

cout<<" Have a good day"<<endl;

return 0;

You might also like