1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
const int ROW = 4;
const int COL = 5;
void displayArray1(string [][COL], int [][COL], int ROW, int COL);
int main()
{
string seatingChart[ROW][COL] = {
{"Joe", "Moe", "Curly", "Diana", "Beth"},
{"Ben", "Bart", "Deb", "Nick", "Harry"},
{"Kaitland", "Matt", "Tom", "Sean", "June"},
{"Jean", "Sarah", "Sara", "Elizabeth", "Jessica"}
};
int grades[ROW][COL] = {
{99, 55, 45, 77, 67},
{98, 78, 88, 78, 88},
{72, 76, 99, 76, 86},
{89, 77, 97, 88, 75}
};
cout << setw(34) << right << "(front of room)\n";
cout << "----------------------------------------------------------------------";
cout << setw(33) << right << "Seating Chart\n" << endl << endl;
displayArray1(seatingChart, grades, ROW, COL);
cin.get();
return 0;
}
{ // <-- error points here
void displayArray1(string [][COL], int [][COL], int ROW, int COL);
for(int i = 0; i < ROW; i++)
{
for(int j = 0; j < COL; j++)
{
cout << setw(15) << left << seatingChart[i][j];
cout << setw(15) << left << "(" << grades[i][j] << ")";
}
}
}
|