My instructions are to create a data file with some test scores. The problem is I cant figure out how to get the input file to fill the arrays.
Assume there are only 3 students and 5 tests for each of the students.
Each row represents the test scores of a student. Each student's scores is in different row.
80.0 90.0 50.0 45.0 34.5
77.0 76.0 76.6 50.6 90.0
34.9 24.1 66.0 70.2 60.2
create a program that asks for an input file that has the structure above. Read the data into arrays (one array for a student) of floats. Manipulate the data by loops. Then average the scores of each students test then average each test. This is what I have its not much but I don't need it solved just pointed into the right direction.
I would use std::string instead of a char[], because if I enter, say, 20 characters, you program will be accessing bad memory.
Your a,b,c arrays are arrays on ints, you want them to be doubles (since you are reading doubles).
i is never defined, a[i] could be really bad.
You did c[4], but are accessing element 4, bad. c[4] gives you c[0]-c[3].
You will want a (for) loop to fill all the arrays, not just a single statement.
and then the same loop for b[] and c[]. I tried something to that effect earlier and got some crazy numbers like the loop wasn't working. Thanks for the help.