if((menuchoice<0)&&(menuchoice>5))
{
puts("invalid choice");
system("pause try again");
}
else
{
switch(menuchoice){
case 1:reserve();break;
case 2:cancel();break;
case 3:changeseat();break;
case 4:display();break;
case 5:exit(1);
}
}
}
return 0;
}
void reserve()//this function is for reserve the seats
{
int pass_num=0;
int i, j;
prinft("Welcome to cheapskate airline passenger seat assigment");
prinft("all %d seats are available", numseats);
for(i=0;i<6;i++)
{
for(j=0;j<2;j++)
{
if(seatarray[i][j].available==1)
{
printf("please enter the passenger name: ");
scanf("%s",seatarray[i][j].pass_name);
seatarray[i][j].available-0;
numseats--;
return;
}
}
}
}
void cancel()//this function is for cancel the seats
{
char cancelpassengername[80];
int i, j;
printf("enter the passenger to be canceled:");
scanf("%s",&cancelpassengername);
for(i=0;i<6;i++)
{
for(j=0;j<2;j++)
{
if(strcmp(seatarray[i][j].pass_name,cancelpassengername)==0)
{
numseats++;
seatarray[i][j].available=1;
return;
}
}
}
printf("passenger not in the list");
}
void changeseat()//this function is for change the seats
{
char movepassenger[80];
int seatrow, seatcolumn, i, j;
printf("enter the passenger name to be move: ");
scanf("%s",&movepassenger);
for(i=0;i<6;i++)
{
for(j=0;j<2;j++)
{
if(strcmp(seatarray[i][j].pass_name, movepassenger)==0)
{
seatrow=i;
seatcolumn=j;
}
}
}
if(numseats<=0)
{
printf("no seat available there for you cannot change seat");
return;
}
else{
for(i=0;i<6;i++)
{
for(j=0;j<2;j++)
{
if(seatarray[i][j].available==1)
{
strcpy_s(seatarray[i][j].pass_name,movepassenger);
seatarray[seatrow][seatcolumn].available==1;
seatarray[i][j].available=0;
return;
}
}
}
}
}
void display()//display the seat assignment for all reservation
{
for(i=0;i<6;i++)
{
for(j=0;j<2;j++)
{
if(seatarray[i][j].available==0)
{
printf("%s %d",seatarray[i][j].pass_name, numseat);
}
else
{
if(j==1)
printf(i+1"b");
else
printf(i+1"a");
}
}
}
}
void initializeseats()//initialy all seats are available
{
for(i=0;i<12;i++)
{
for(j=0;j<2;j++)
seatarray[i][j].available=1;
}
}
a) Use code tags when posting code.
b) State your problem clearly.
c) Do not use deprecated .h version of headers
d) There is no prinft() function.
... I didn't look further. You didn't even try to do this yourself, did you? All errors are clearly stated by the compiler.