educative.io

Student’s Records example. Number of columns?!

In Student’s Records example, why we will allocate 6 columns only instead of 7 columns.

We have 6 subjects a column for each one and another column for student, right?

Please, correct me if I am wrong.

Thanks

Hi Mody!

The reason why there are only 6 columns in the Student’s Records array is that each of the 30 rows contains the grade records of each individual student, with the first row containing the grades for Student 1, the second row for Student 2, and so on.

For example, the grade of Student 3 in Subject 5 can be accessed by doing studentRecords[2][4] (assuming the name of the array is studentRecords).

1 Like

I understand now why we need just 6 columns.

Thanks for your explanation.

1 Like