Answer to Question #153886 in C++ for Ali

Question #153886

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


1
Expert's answer
2021-01-05T14:28:17-0500
#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;}









Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog