Well, this is a mishmash, but it should compile, and show what I need it to show.
Code:
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <iomanip.h>
#include <stdio.h>
const int PLANE = 4, ROWS = 41, SEATS = 6;
void display (int [][ROWS][SEATS], int);
void forloop (int [][ROWS][SEATS], int);
int main ()
{
int planebooker [PLANE] [ROWS] [SEATS] = {0};
forloop(planebooker, PLANE);
getch();
display(planebooker, PLANE);
return 0;
}
void display (int planebooker[][ROWS][SEATS], int x)
{
int counter, seatnumber;
// x is the plane, y is the row, z is the seats
seatnumber = 1;
cout << setw(26) << "1111111111" << "2222222222";
cout << "33333333334" << endl;
cout << setw(11) << "12345" << " " << "67890";
cout << "1234567890" << "1234567890" ;
cout << "1234567890" << endl;
for (int z = 1 ; z < SEATS ; z++)
{
counter = 0;
for (int y = 1 ; y < ROWS ; y++)
{
if (counter == 0)
cout << setw(5) << seatnumber << " ";
if ((counter - 5) == 0)
cout << " ";
cout << planebooker [PLANE][ROWS][SEATS];
counter++;
}
seatnumber++;
cout << endl;
}
cout << setw(12) << " FIRST " << setw(20);
cout << "COACH" << endl;
cout << setw(12) << " CLASS " << endl;
getch();
}
void forloop (int planebooker[][ROWS][SEATS], int x)
{
for (int x = 1 ; x < 4 ; x++)
{
for (int y = 1; y < 41 ; y++)
{
for (int z = 1 ; z < 6 ; z++)
{
planebooker [x][y][z] = 1;
}
}
}
}
Sorry If I messed something up jammin it in there.