Help with arrays

Here is my code so far

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
 #include <iostream>
#include <fstream>
#include <string>
using namespace std;


int main()
{
	string names[16], fileName;
	double IDs[16], exams[16][16], labs[16][16][16][16], programs[16][16][16], numberOfStudents;

	double totalExams, totalLabs, totalPrograms, labsPercentage, examsPercentage, programsPercentage, totalGrade;
	char gradeLetter;

	double  labsAverage = 0, labs, programsAverage = 0, programs, examsAverage = 0, exams, gradeAverage = 0, averageGrade = 0;
	double AverageExams = 0.0, AverageLabs = 0.0, AveragePrograms = 0.0, AverageGrade = 0.0;

	getline(cin, fileName);


	ifstream ifFile;
	ofstream ofFile;
	ifFile.open(fileName);
	ofFile.open("Output.txt");

	if (ifFile.fail())
	{
		cout << "Failed to open input file";
		exit(1);
	}

	if (ofFile.fail())
	{
		cout << "Failed to open output file";
		exit(1);
	}


	for (int i = 0; i < numberOfStudents; i++)
	{
		ifFile >> names[i] >> IDs[i] >> exams[i][0] >> exams[0][i] >> programs[i][0][0] >> programs[0][i][0] >> programs[0][0][i] >> labs[i][0][0][0] >> labs[0][i][0][0] >> labs[0][0][i][0] >> labs[0][0][0][i];


		numberOfStudents = numberOfStudents++;

		totalExams = exams[i][0] + exams[0][i];
		totalLabs = labs[i][0][0][0] + labs[0][i][0][0] + labs[0][0][i][0] + labs[0][0][0][i];
		totalPrograms = programs[i][0][0] + programs[0][i][0] + programs[0][0][i];


		labsPercentage = ((totalLabs / 100) * 100) * 0.25;
		examsPercentage = ((totalExams / 60) * 100) * 0.5;
		programsPercentage = ((totalPrograms / 75) * 100) * 0.25;

		totalGrade = labsPercentage + programsPercentage + examsPercentage;
		if (totalGrade >= 90)
		{
			gradeLetter = 'A';
		}
		else if (totalGrade >= 80)
		{
			gradeLetter = 'B';
		}
		else if (totalGrade >= 70)
		{
			gradeLetter = 'C';
		}
		else if (totalGrade >= 60)
		{
			gradeLetter = 'D';
		}
		else
		{
			gradeLetter = 'F';
		}

		cout << endl << "Student Number: " << IDs[i] << endl << "Student Name:   " << names[i] << endl << "Exams (1 & 2): " << exams[i][0] << ", " << exams[0][i] << endl << "Programs (1,2,3): " << programs[i][0][0] << ", " <<
			programs[0][i][0] << ", " << programs[0][0][i] << endl <<
			"Labs (1,2,3,4): " << labs[i][0][0][0] << ", " << labs[0][i][0][0] << ", " << labs[0][0][i][0] << ", " << labs[0][0][0][i] << endl << "Total Grade" << totalGrade << " ( " << gradeLetter << " )" << endl;


	}





	averageGrade += totalGrade;
	programsAverage += totalPrograms;
	labsAverage += totalLabs;
	examsAverage += totalExams;



	AverageExams = ((examsAverage / numberOfStudents) / 60) * 100;
	AverageGrade = averageGrade / numberOfStudents;
	AverageLabs = ((labsAverage / numberOfStudents) / 100) * 100;
	AveragePrograms = ((programsAverage / numberOfStudents) / 75) * 100;


	cout << endl << "The average grade of this class for " << numberOfStudents << " is: " << AverageGrade << "%" << endl << "Average Exams: " << AverageExams << "%" << endl << "Average Programs: " << AveragePrograms << "%" << endl << "Average Labs: " <<
		AverageLabs << "%";










	system("PAUSE");
	return 0;
}


I am supposed to read information for many students from a txt file, and place it in 3d arrays,
my question is why i get error here:
 
	double  labsAverage = 0, labs, programsAverage = 0, programs, examsAverage = 0, exams, gradeAverage = 0, averageGrade = 0;


and is this the right way to read into 3D arrays:
1
2
3

ifFile >> names[i] >> IDs[i] >> exams[i][0] >> exams[0][i] >> programs[i][0][0] >> programs[0][i][0] >> programs[0][0][i] >> labs[i][0][0][0] >> labs[0][i][0][0] >> labs[0][0][i][0] >> labs[0][0][0][i];
Topic archived. No new replies allowed.