Question: How do I make a execution chart for this C++ code? #include using namespace std; void initialize(char seats[][4]){ for(int i=0;i <7;i++){ for(int j=0;j <4;j++){ seats[i][j]='0';

How do I make a execution chart for this C++ code?

#include using namespace std; void initialize(char seats[][4]){ for(int i=0;i<7;i++){ for(int j=0;j<4;j++){ seats[i][j]='\0'; } } } bool reserve(char seats[][4],int n,char x){ if(seats[n-1][x-'A']!='X'){ return true; } return false; } bool cancel(char seats[][4],int n,char x){ if(seats[n-1][x-'A']=='X'){ return true; } return false; } bool isfull(char seats[][4]){ for(int i=0;i<7;i++){ for(int j=0;j<4;j++){ if(seats[i][j]=='\0'){ return false; } } } return true; } int main(){ char seats[7][4],ch,x; int n; initialize(seats); while(1){ cout<<"Reserve Seat - R Cancel Seat - C Display All Available Seats - D Q-To quit"<>ch; if(ch=='R'){ if(isfull(seats)){ cout<<"The Flight is full"<>n>>x; while(1){ if((n>=1 && n<=7) &&(x>='A' &&x<='D')){ break; }else{ cout<<"Invalid details Please try again "<>n>>x; } if(reserve(seats,n,x)){ seats[n-1][x-'A']='X'; cout<<" Seat reserved Successfully "<>n>>x; while(1){ if((n>=1 && n<=7) &&(x>='A' &&x<='D')){ break; }else{ cout<<" Invalid details Please try again "<>n>>x; } if(cancel(seats,n,x)){ seats[n-1][x-'A']='\0'; cout<<" Seat canceled "<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!