Gradebook Problem

Hello! I'm pretty new to this and I'm having some trouble creating a gradebook.
after asking for student id's along with test numbers and test scores, the program is supposed to list everything out. I'm fairly certain the problem is in the arrays. any help will be greatly appreciated.

#include <iostream>
#include <iomanip>
using namespace std;

int main ()
{
const int MAX_STUDENTS = 50;
const int MAX_TESTS = 10;
double testave[MAX_TESTS];
int testscore[MAX_STUDENTS][MAX_TESTS];
int nstuds, ntests;


cout << "Welcome to Grade Book version 0.1\n" << "Copyright (C) Andy Pak 2009. All rights reserved.\n\n";

cout << "Enter maximum number of students and tests: ";


cin >> nstuds >> ntests;
int i = 0;
int j = 0;
int sid[MAX_STUDENTS] = {0};
int tid[MAX_TESTS] = {0};


if ((nstuds <= MAX_STUDENTS) && (ntests <= MAX_TESTS))
{

cout << "Enter student id: ";
cin >> sid[i + 1];
while (sid[i + 1] != 0)
{
cout << "Enter test number and score: ";
cin >> tid[j + 1] >> testscore[i + 1][j + 1];
cout << "Enter student id: ";
cin >> sid[i + 1];
}

cout << "Id";
for (int test = 1; test <= ntests; test++)
{
cout << setw(7) << test;
}
cout << "\n";
for (int lines = 0; lines <= ntests; lines++)
{
cout << "_______";
}
cout << "\n";
for (int stud = 1; stud <= nstuds; stud++)
{
cout << setw(2) << stud;
{
for (int score = 1; score <= ntests; score++)
cout << setw(7) << testscore[i + 1][j + 1];
}
cout << "\n";
}
}
return 0;
}
Topic archived. No new replies allowed.