Hi,
Please consider the following folder structure:
There is a School Folder.
Inside that there are 6 subfolders Grade7, Grade8, ... Grade 12.
Inside EACH of these grade folders, there are files like Exam.txt, Quiz.txt, Sports.txt, Debate.txt, etc.
Content of these text files differs but format is the same.
Each line has the student name followed by space separated scores.
For example
Quiz.txt in Grade8 folder has
Alex 6.6 7.8 9.3
Bob 10.0 9.8 8.8
Cathy 5.5 6.6 7.7
Sports.txt in Grade8 folder has
Alex 9.6 10.0 10.0
Bob 10.0 9.8 8.8
Cathy 7.5 6.9 2.1
Quiz.txt in Grade12 folder has
Joe 5.2 6.6 4.3
Sidney 1.0 2.8 5.1
Trisha 0.0 0.0 0.0
I do not have much experience with C++ and was just wondering what is the best way to represent this data, so that it can be read efficiently for further processing.
Please suggest if a map would be the best way to represent this data?
Something like
map<string, map<string, map<string, double*>>> schoolData
To represent Sidney's quiz data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
map<string, map<string, map<string, double*>>> schoolData;
map<string, map<string, double*> studentquizData;
map<string, double*> studentData;
double* scores;
scores[0] = 1.0;
scores[1] = 2.8;
scores[2] = 5.1;
studentData["Sidney"] = scores;
studentquizData["Quiz.txt"] = studentData;
schoolData["Grade12"] = studentquizData;
|
I am using folders like quiz, exam, etc. for simplicity. In implementation, these will be named Ex1, Ex2 that will help in looping the code.
Thank you