Design ahealth booking system using oop concepts the system enabled the patient to book afree slot for medical checkup.every patient is associated with int registeration no,char name,bool booking slot .your health booking slot should do the following
1-create an abject of patient
2-register a particular paitient(the pateint details)
3-display the patient details
4-book a particular free slots
5-cancel already booked slot
#include<iostream.h>
int slot[10],n;
class patient {
public:
int regno;
char name[10];
bool booking;
void regist(){
cout<<"Enter patient number."<<endl;
cin>>regno;
cout<<"Enter patient name."<<endl;
cin>>name;
cout<<"Enter freeslot number between 1 and 10."<<endl;
cin>>n;
if(slot[n]>=-1){
cout<<"booked try another"<<endl;
}else{
slot[n]=n;
cout<<"booked successfully"<<endl;
}
}
void cancel(){
cout<<"cancelled"<<endl;
}
};
int main(){
for(int i=1;i<=10;++i){
slot[i]=-1;
}
for( i=1;i<=10;++i){
cout<<slot[i]<<endl;
}
patient p;
p.regist();
return 0;}
Comments
Leave a comment