#include<stdio.h>
#define SIZE 10
void printbookings(int[],int);
float income(int[],int,float);
int main(){
int bookings[SIZE]={0,0,0,0,0,0,0,0,0,0};
int numflt=SIZE;
int count;
float seatcost=120.00;
printbookings(bookings,numflt);
FILE *inp;
inp=fopen("a:flightinfo","r");
int trans,fltnum,numseats;
for(count=0;count++){
fscanf(inp,"%d %d %d/n",&trans,&fltnum,&numseats);
if (trans==1){
bookings[fltnum]+= numseats;
printf("\nBooked %d seats on flight %d",numseats,fltnum);
}
else {
if(trans==2&&bookings[fltnum]>numseats)
{
bookings[numflt]-=numseats;
printf("\nCancelled %d seats on flight %d",numseats,fltnum);
}
else {
if(trans==2&&bookings[fltnum]<numseats)
printf("\nError:Transaction Invalid");
}
}
}
fclose(inp);
printbookings(bookings,numflt);
printf("Total revenue: %f",income(bookings,numflt,seatcost));
return 0;
}
/*Function prints the current bookings of Brooklyn Airlines*/
void printbookings(int num[],int numflt){
int count;
for(count=0;count<numflt;count++)
printf("%d %d\n",count,num[count]);
return;
}
/*Function calculates the total revenue of Brooklyn Airlines*/
float income(int num[], int numflt, float seatcost){
int count,total=0;
for(count=0;count<numflt;count++)
total+= num[count];
return total* seatcost;
}
Here are the errors:
Compiling NONAME01.CPP:
Error NONAME01.CPP 17: For statement missing ; in function main()
Warning NONAME01.CPP 41: 'numseats' is declared but never used in function main()
Warning NONAME01.CPP 41: 'fltnum' is declared but never used in function main()
Warning NONAME01.CPP 41: 'trans' is declared but never used in function main()
Warning NONAME01.CPP 41: 'inp' is assigned a value that is never used in function main()
Warning NONAME01.CPP 41: 'count' is assigned a value that is never used in function main()
I cannot figure out where the semi-colon it says is missing is supposed to go!
Please help me!